Commit 8dd67ed9 authored by prumde's avatar prumde

Updated for Location and Cart updated count


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174385 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 96ae6741
import { Category } from '../ecm-model/category-model'; import { Category } from '../ecm-model/category-model';
import { SubCategory } from '../ecm-model/subcategory-model'; import { SubCategory } from '../ecm-model/subcategory-model';
import { Item } from '../ecm-model/product-model'; import { Item } from '../ecm-model/product-model';
import { EcmLocation} from '../ecm-search/ecm-location';
export class EcmStoreModel { export class EcmStoreModel {
CATEGORY: Category; CATEGORY: Category;
SUBCATEGORY: SubCategory; SUBCATEGORY: SubCategory;
ITEM: Item; ITEM: Item;
ECM_LOCATION: EcmLocation;
CART_COUNTER: number;
}; };
import { ActionReducer, Action } from '@ngrx/store';
export function CATEGORY (state: any = null, {type, payload}) { export function CATEGORY (state: any = null, {type, payload}) {
switch (type) { switch (type) {
case 'CATEGORY': case 'CATEGORY':
...@@ -36,3 +38,37 @@ export function ITEM (state: any = null, {type, payload}) { ...@@ -36,3 +38,37 @@ export function ITEM (state: any = null, {type, payload}) {
return state; return state;
} }
}; };
export function ECM_LOCATION (state: any = null, {type, payload}) {
switch (type) {
case 'ECMLOCATION':
return payload;
case 'CLEAR_LOCATION':
return state=null;
default:
return state;
}
};
export const INCREMENT = 'INCREMENT';
export const DECREMENT = 'DECREMENT';
export const RESET = 'RESET';
export function CART_COUNTER(state: number = 0, action: Action) {
switch (action.type) {
case INCREMENT:
return state + 1;
case DECREMENT:
return state - 1;
case RESET:
return 0;
default:
return state;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment