feat(help-center): expose public category lists
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user