diff --git a/controllers/ImportController.go b/controllers/ImportController.go index fdc034d..0110643 100644 --- a/controllers/ImportController.go +++ b/controllers/ImportController.go @@ -215,6 +215,8 @@ func getCats(db *gorm.DB, catIDs []int) ([]gm.Category, string, error) { var categories []gm.Category var keywords string + log.Println(catIDs) + if len(mainCategories) > 0 { for _, id := range catIDs { for _, item := range mainCategories { @@ -230,8 +232,10 @@ func getCats(db *gorm.DB, catIDs []int) ([]gm.Category, string, error) { errCat := db.Preload("Translations").Find(&categories, catIDs).Error if errCat != nil { + log.Println(errCat) return categories, keywords, errCat } + } for _, cat := range categories { @@ -242,7 +246,7 @@ func getCats(db *gorm.DB, catIDs []int) ([]gm.Category, string, error) { } } - log.Println(catIDs, categories) + log.Println(categories) return categories, keywords, nil }