Design anpassungen
This commit is contained in:
@@ -31,7 +31,7 @@ func (p *Category) GetCategory(db *gorm.DB, sectionID string) (*[]Category, erro
|
||||
func (p *Category) GetCategoryByID(db *gorm.DB, categoryID string) (*Category, error) {
|
||||
var result Category
|
||||
|
||||
err := db.Debug().Model(&Category{}).Where("id = ?", categoryID).Find(&result).Error
|
||||
err := db.Debug().Preload("Section").Model(&Category{}).Where("id = ?", categoryID).Find(&result).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user