Skip to content

Commit

Permalink
Fix category
Browse files Browse the repository at this point in the history
  • Loading branch information
matherg committed Dec 3, 2023
1 parent 536eb5d commit d155220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/model/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func SearchGiftsDb(db *gorm.DB, id int64, searchTerm string, minPrice int, maxPr
}

if category != "" {
query = query.Where("category has ?", category)
query = query.Where("? = ANY(category)", category)
}
query = query.Preload("GiftCollections")

Expand Down Expand Up @@ -291,7 +291,7 @@ func AddGiftToCustomerCollectionFromDB(db *gorm.DB, gift Gift, collectionName st

collection.Gifts = append(collection.Gifts, &gift)

if err:= db.Save(&collection).Error; err != nil {
if err := db.Save(&collection).Error; err != nil {
return GiftCollection{}, err
}

Expand Down

0 comments on commit d155220

Please sign in to comment.