Explorar el Código

feat(admin-ui): Support channel-aware Facets & FacetValues

Relates to #612
Michael Bromley hace 5 años
padre
commit
4ccc65e7b5

+ 2 - 2
packages/admin-ui/src/lib/catalog/src/components/facet-detail/facet-detail.component.ts

@@ -133,7 +133,7 @@ export class FacetDetailComponent
                     ) as CreateFacetInput;
                     return this.dataService.facet.createFacet(newFacet);
                 }),
-                switchMap(data => this.dataService.facet.getAllFacets(true).single$.pipe(mapTo(data))),
+                switchMap(data => this.dataService.facet.getAllFacets().single$.pipe(mapTo(data))),
             )
             .subscribe(
                 data => {
@@ -196,7 +196,7 @@ export class FacetDetailComponent
 
                     return forkJoin(updateOperations);
                 }),
-                switchMap(() => this.dataService.facet.getAllFacets(true).single$),
+                switchMap(() => this.dataService.facet.getAllFacets().single$),
             )
             .subscribe(
                 () => {

+ 1 - 1
packages/admin-ui/src/lib/catalog/src/components/facet-list/facet-list.component.ts

@@ -52,7 +52,7 @@ export class FacetListComponent extends BaseListComponent<GetFacetList.Query, Ge
                     }
                 }),
                 // Refresh the cached facets to reflect the changes
-                switchMap(() => this.dataService.facet.getAllFacets(true).single$),
+                switchMap(() => this.dataService.facet.getAllFacets().single$),
             )
             .subscribe(
                 () => {

+ 2 - 6
packages/admin-ui/src/lib/core/src/data/providers/facet-data.service.ts

@@ -39,12 +39,8 @@ export class FacetDataService {
         });
     }
 
-    getAllFacets(refresh: boolean = false) {
-        return this.baseDataService.query<GetFacetList.Query, GetFacetList.Variables>(
-            GET_FACET_LIST,
-            {},
-            refresh ? 'network-only' : 'cache-first',
-        );
+    getAllFacets() {
+        return this.baseDataService.query<GetFacetList.Query, GetFacetList.Variables>(GET_FACET_LIST, {});
     }
 
     getFacet(id: string) {