diff --git a/services/utilsService.go b/services/utilsService.go index 09012cf..01d1825 100644 --- a/services/utilsService.go +++ b/services/utilsService.go @@ -48,5 +48,25 @@ func (s *utilsService) GetAppConfig(configID int) (models.Appconfig, error) { } func (s *utilsService) GetAppCategory() ([]models.AppCategory, error) { - return s.repo.GetAppCategory() + categories, err := s.repo.GetAppCategory() + if err != nil { + return nil, err + } + + // "All" is a synthetic pseudo-category, not a real app_category row — it + // must never be inserted into app_category itself, since product-listing + // filters (e.g. ProductController.GetAllProducts) already treat + // categoryid=0 as "no category filter". Keeping this row's id at 0 reuses + // that existing convention instead of adding a new one. + all := models.AppCategory{ + Categoryid: 0, + Categoryname: "All", + Categorytype: 7, + Sortorder: 0, + Crossaxis: 1, + Mainaxis: 1, + Status: "Active", + } + + return append([]models.AppCategory{all}, categories...), nil }