Skip to content

Commit

Permalink
feat(admin-ui): PaymentMethod & promotions list update on channel change
Browse files Browse the repository at this point in the history
Relates to #587
  • Loading branch information
michaelbromley committed Mar 4, 2021
1 parent 1a3b04f commit c02518c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { EMPTY } from 'rxjs';
import { switchMap } from 'rxjs/operators';

import { BaseListComponent } from '@vendure/admin-ui/core';
import { GetPromotionList } from '@vendure/admin-ui/core';
import { NotificationService } from '@vendure/admin-ui/core';
import { DataService } from '@vendure/admin-ui/core';
import { ModalService } from '@vendure/admin-ui/core';
import { EMPTY } from 'rxjs';
import { switchMap } from 'rxjs/operators';

@Component({
selector: 'vdr-promotion-list',
Expand All @@ -29,7 +28,7 @@ export class PromotionListComponent extends BaseListComponent<
) {
super(router, route);
super.setQueryFn(
(...args: any[]) => this.dataService.promotion.getPromotions(...args),
(...args: any[]) => this.dataService.promotion.getPromotions(...args).refetchOnChannelChange(),
data => data.promotions,
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

import { BaseListComponent } from '@vendure/admin-ui/core';
import { GetPaymentMethodList } from '@vendure/admin-ui/core';
import { DataService } from '@vendure/admin-ui/core';
Expand All @@ -18,7 +17,7 @@ export class PaymentMethodListComponent extends BaseListComponent<
constructor(private dataService: DataService, router: Router, route: ActivatedRoute) {
super(router, route);
super.setQueryFn(
(...args: any[]) => this.dataService.settings.getPaymentMethods(...args),
(...args: any[]) => this.dataService.settings.getPaymentMethods(...args).refetchOnChannelChange(),
data => data.paymentMethods,
);
}
Expand Down

0 comments on commit c02518c

Please sign in to comment.