Skip to content

Commit cb40ae2

Browse files
committed
fix: #141 load customers
1 parent 3c88af4 commit cb40ae2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/modules/customer-management/store/customer-management.reducers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export function customerManagementReducer(
2929
case CustomerManagementActionTypes.LOAD_CUSTOMERS_SUCCESS: {
3030
return {
3131
...state,
32-
customers: action.payload,
32+
data: action.payload,
3333
isLoading: false,
3434
};
3535
}
3636
case CustomerManagementActionTypes.LOAD_CUSTOMERS_FAIL: {
3737
return {
3838
...state,
39-
customers: [],
39+
data: [],
4040
isLoading: false,
4141
};
4242
}
@@ -51,7 +51,7 @@ export function customerManagementReducer(
5151
case CustomerManagementActionTypes.CREATE_CUSTOMER_SUCCESS: {
5252
return {
5353
...state,
54-
data: [action.payload],
54+
data: [...state.data, action.payload],
5555
isLoading: false,
5656
message: 'Customer created successfully!',
5757
};

src/app/modules/customer-management/store/customer-management.selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export const getStatusMessage = createSelector(getCustomerState, (messageState)
1010
});
1111

1212
export const allCustomers = createSelector(getCustomerState, (state: CustomerState) => {
13-
return state.customers;
13+
return state.data;
1414
});

0 commit comments

Comments
 (0)