This commit is contained in:
merdan 2022-09-25 22:01:29 +05:00
parent 988ea73d58
commit 883cc13e8b
1 changed files with 5 additions and 1 deletions

View File

@ -215,6 +215,8 @@ func getCats(db *gorm.DB, catIDs []int) ([]gm.Category, string, error) {
var categories []gm.Category var categories []gm.Category
var keywords string var keywords string
log.Println(catIDs)
if len(mainCategories) > 0 { if len(mainCategories) > 0 {
for _, id := range catIDs { for _, id := range catIDs {
for _, item := range mainCategories { 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 errCat := db.Preload("Translations").Find(&categories, catIDs).Error
if errCat != nil { if errCat != nil {
log.Println(errCat)
return categories, keywords, errCat return categories, keywords, errCat
} }
} }
for _, cat := range categories { 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 return categories, keywords, nil
} }