fix
This commit is contained in:
parent
988ea73d58
commit
883cc13e8b
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue