feat: scope articles by brand
This commit is contained in:
@@ -98,9 +98,16 @@ type BrandLibrarySummaryResponse struct {
|
||||
|
||||
func (s *BrandService) List(ctx context.Context) ([]BrandResponse, error) {
|
||||
actor := auth.MustActor(ctx)
|
||||
return sharedcache.LoadJSON(ctx, s.cache, &s.cacheGroup, brandListCacheKey(actor.TenantID), defaultCacheTTL(), func(loadCtx context.Context) ([]BrandResponse, error) {
|
||||
brands, err := sharedcache.LoadJSON(ctx, s.cache, &s.cacheGroup, brandListCacheKey(actor.TenantID), defaultCacheTTL(), func(loadCtx context.Context) ([]BrandResponse, error) {
|
||||
return s.loadBrands(loadCtx, actor.TenantID)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if brands == nil {
|
||||
return []BrandResponse{}, nil
|
||||
}
|
||||
return brands, nil
|
||||
}
|
||||
|
||||
func (s *BrandService) Summary(ctx context.Context) (*BrandLibrarySummaryResponse, error) {
|
||||
|
||||
Reference in New Issue
Block a user