All files / src/app/extensions/wishlists/store/wishlist wishlist.actions.ts

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

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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 7810x   10x       10x   10x         10x   10x   10x         10x   10x   10x         10x   10x   10x         10x   10x         10x         10x   10x         10x         10x         10x         10x   10x  
import { createAction } from '@ngrx/store';
 
import { httpError, payload } from 'ish-core/utils/ngrx-creators';
 
import { Wishlist, WishlistHeader } from '../../models/wishlist/wishlist.model';
 
export const loadWishlists = createAction('[Wishlist Internal] Load Wishlists');
 
export const loadWishlistsSuccess = createAction(
  '[Wishlist API] Load Wishlists Success',
  payload<{ wishlists: Wishlist[] }>()
);
 
export const loadWishlistsFail = createAction('[Wishlist API] Load Wishlists Fail', httpError());
 
export const createWishlist = createAction('[Wishlist] Create Wishlist', payload<{ wishlist: WishlistHeader }>());
 
export const createWishlistSuccess = createAction(
  '[Wishlist API] Create Wishlist Success',
  payload<{ wishlist: Wishlist }>()
);
 
export const createWishlistFail = createAction('[Wishlist API] Create Wishlist Fail', httpError());
 
export const updateWishlist = createAction('[Wishlist] Update Wishlist', payload<{ wishlist: Wishlist }>());
 
export const updateWishlistSuccess = createAction(
  '[Wishlist API] Update Wishlist Success',
  payload<{ wishlist: Wishlist }>()
);
 
export const updateWishlistFail = createAction('[Wishlist API] Update Wishlist Fail', httpError());
 
export const deleteWishlist = createAction('[Wishlist] Delete Wishlist', payload<{ wishlistId: string }>());
 
export const deleteWishlistSuccess = createAction(
  '[Wishlist API] Delete Wishlist Success',
  payload<{ wishlistId: string }>()
);
 
export const deleteWishlistFail = createAction('[Wishlist API] Delete Wishlist Fail', httpError());
 
export const addProductToWishlist = createAction(
  '[Wishlist] Add Item to Wishlist',
  payload<{ wishlistId: string; sku: string; quantity?: number }>()
);
 
export const addProductToWishlistSuccess = createAction(
  '[Wishlist API] Add Item to Wishlist Success',
  payload<{ wishlist: Wishlist }>()
);
 
export const addProductToWishlistFail = createAction('[Wishlist API] Add Item to Wishlist Fail', httpError());
 
export const addProductToNewWishlist = createAction(
  '[Wishlist] Add Product To New Wishlist',
  payload<{ title: string; sku: string }>()
);
 
export const moveItemToWishlist = createAction(
  '[Wishlist] Move Item to another Wishlist',
  payload<{ source: { id: string }; target: { id?: string; title?: string; sku: string } }>()
);
 
export const removeItemFromWishlist = createAction(
  '[Wishlist] Remove Item from Wishlist',
  payload<{ wishlistId: string; sku: string }>()
);
 
export const removeItemFromWishlistSuccess = createAction(
  '[Wishlist API] Remove Item from Wishlist Success',
  payload<{ wishlist: Wishlist }>()
);
 
export const removeItemFromWishlistFail = createAction('[Wishlist API] Remove Item from Wishlist Fail', httpError());
 
export const selectWishlist = createAction('[Wishlist Internal] Select Wishlist', payload<{ id: string }>());