sensor reducer bug fix

This commit is contained in:
insanity 2018-05-29 13:58:18 +09:00
parent 740e245cd7
commit 057e51fd73

View File

@ -15,11 +15,11 @@ export function reducer(state = initialState, action: Actions): State {
} }
case ActionType.ReadAllByDomainIDSuccess: { case ActionType.ReadAllByDomainIDSuccess: {
return sensorListContainerAdapter.setAll(action.payload.content, {...state, page: action.payload, pending: false}); return sensorListContainerAdapter.setAll(action.payload.content, { ...state, page: action.payload, pending: false });
} }
case ActionType.ReadAllByDomainIDFailure: { case ActionType.ReadAllByDomainIDFailure: {
return sensorListContainerAdapter.setError(action.payload, {...state, page: null, pending: false}); return sensorListContainerAdapter.setError(action.payload, { ...state, page: null, pending: false });
} }
case ActionType.Read: { case ActionType.Read: {
@ -30,11 +30,11 @@ export function reducer(state = initialState, action: Actions): State {
} }
case ActionType.ReadSuccess: { case ActionType.ReadSuccess: {
return sensorListContainerAdapter.setOne(action.payload, {...state, page: null, pending: false}); return sensorListContainerAdapter.setOne(action.payload, { ...state, page: null, pending: false });
} }
case ActionType.ReadFailure: { case ActionType.ReadFailure: {
return sensorListContainerAdapter.setError(action.payload, {...state, pending: false}); return sensorListContainerAdapter.setError(action.payload, { ...state, pending: false });
} }
case ActionType.Modify: { case ActionType.Modify: {
@ -51,5 +51,8 @@ export function reducer(state = initialState, action: Actions): State {
case ActionType.ModifyFailure: { case ActionType.ModifyFailure: {
return sensorListContainerAdapter.setError(action.payload, state); return sensorListContainerAdapter.setError(action.payload, state);
} }
default:
return state;
} }
} }