aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/item/service.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2025-10-13 01:32:27 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2025-10-13 01:32:27 +0530
commit0f435049cb3cc6900d881c5dce43bec3a1e60e2e (patch)
tree374950fba5605ea8411da428ac94b1deef4e2809 /item/service.go
parentfb9ba155438100f295fdb563ad955151ee038ad3 (diff)
added item variantsHEADv0.22.0master
Diffstat (limited to 'item/service.go')
-rw-r--r--item/service.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/item/service.go b/item/service.go
index 7a622cb..87d73fa 100644
--- a/item/service.go
+++ b/item/service.go
@@ -22,7 +22,7 @@ import (
)
func getItem(item *SavedItem, id uint) error {
- res := db.Find(&item, id)
+ res := db.Preload("Variants").Find(&item, id)
// TODO: handle potential errors
if res.Error != nil {
@@ -37,7 +37,7 @@ func getItem(item *SavedItem, id uint) error {
}
func getItems(items *[]SavedItem) error {
- res := db.Find(&items)
+ res := db.Preload("Variants").Find(&items)
// TODO: handle potential errors
if res.Error != nil {