Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: #141 load customers
  • Loading branch information
macrisguncay committed Apr 18, 2020
commit cb40ae2cd794dce755a2f1b525a980497c3cdfd8
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export function customerManagementReducer(
case CustomerManagementActionTypes.LOAD_CUSTOMERS_SUCCESS: {
return {
...state,
customers: action.payload,
data: action.payload,
isLoading: false,
};
}
case CustomerManagementActionTypes.LOAD_CUSTOMERS_FAIL: {
return {
...state,
customers: [],
data: [],
isLoading: false,
};
}
Expand All @@ -51,7 +51,7 @@ export function customerManagementReducer(
case CustomerManagementActionTypes.CREATE_CUSTOMER_SUCCESS: {
return {
...state,
data: [action.payload],
data: [...state.data, action.payload],
isLoading: false,
message: 'Customer created successfully!',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export const getStatusMessage = createSelector(getCustomerState, (messageState)
});

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