Design anpassungen

This commit is contained in:
2023-11-20 19:41:19 +01:00
parent 46382ce455
commit 56038dcff7
6 changed files with 68 additions and 23 deletions

View File

@@ -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
}