All files / src/app/extensions/product-notifications/store/product-notification product-notification.actions.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 0/0
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 406x   6x             6x                           6x                                
import { createActionGroup } from '@ngrx/store';
 
import { httpError, payload } from 'ish-core/utils/ngrx-creators';
 
import {
  ProductNotification,
  ProductNotificationType,
} from '../../models/product-notification/product-notification.model';
 
export const productNotificationsActions = createActionGroup({
  source: 'Product Notifications',
  events: {
    'Load Product Notifications': payload<{ type: ProductNotificationType }>(),
    'Create Product Notification': payload<{ productNotification: ProductNotification }>(),
    'Update Product Notification': payload<{ sku: string; productNotification: ProductNotification }>(),
    'Delete Product Notification': payload<{
      sku: string;
      productNotificationType: ProductNotificationType;
      productNotificationId: string;
    }>(),
  },
});
 
export const productNotificationsApiActions = createActionGroup({
  source: 'Product Notification API',
  events: {
    'Load Product Notifications Success': payload<{
      productNotifications: ProductNotification[];
      type: ProductNotificationType;
    }>(),
    'Load Product Notifications Fail': httpError<{}>(),
    'Create Product Notification Success': payload<{ productNotification: ProductNotification }>(),
    'Create Product Notification Fail': httpError<{}>(),
    'Update Product Notification Success': payload<{ productNotification: ProductNotification }>(),
    'Update Product Notification Fail': httpError<{}>(),
    'Delete Product Notification Success': payload<{ productNotificationId: string }>(),
    'Delete Product Notification Fail': httpError<{}>(),
  },
});