Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
fix: typo in shop offer deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmolly committed Apr 15, 2024
1 parent a4bd791 commit 4ac1bb7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions misc/update_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,16 @@ func importShopOffers(region string, tx *gorm.DB) error {
for decoder.More() {
var offer struct { // decoding to json via a pq.Int64Array is not supported, so we need to decode the effects manually
orm.ShopOffer
Effects_ []uint32 `json:"effects" gorm:"-"`
Effects_ []uint32 `json:"effect_args" gorm:"-"`
}
if err := decoder.Decode(&offer); err != nil {
return err
}

// Manually convert the effects to pq.Int64Array
offer.ShopOffer.Effects = make([]int64, len(offer.Effects_))
for i, effect := range offer.Effects_ {
offer.ShopOffer.Effects[i] = int64(effect)
}

shopOffer := orm.ShopOffer{
ID: offer.ID,
Effects: offer.Effects,
Expand Down

0 comments on commit 4ac1bb7

Please sign in to comment.