feat(help-center): expose public category lists

This commit is contained in:
2026-06-06 07:23:55 +08:00
parent 53434ab397
commit c64b4c2f92
10 changed files with 179 additions and 10 deletions
+8
View File
@@ -95,6 +95,14 @@ func (s *CategoryService) GetByPortalAndID(ctx context.Context, portalID, id uin
return category, nil
}
func (s *CategoryService) GetByPortalSlugAndLocale(ctx context.Context, portalID uint, slug string, locale string) (*model.Category, error) {
category, err := s.repo.FindBySlugAndPortalIDAndLocale(ctx, slug, portalID, locale)
if err != nil {
return nil, fmt.Errorf("get category: %w", err)
}
return category, nil
}
func (s *CategoryService) Update(ctx context.Context, id uint, req *UpdateCategoryRequest) (*model.Category, error) {
category, err := s.repo.GetByID(ctx, id)
if err != nil {