Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case FAILURE(ACTION_TYPES.DELETE_OPERATION):
return {
...state,
loading: false,
updating: false,
updateSuccess: false,
errorMessage: action.payload
};
case SUCCESS(ACTION_TYPES.FETCH_OPERATION_LIST): {
const links = parseHeaderForLinks(action.payload.headers.link);
return {
...state,
loading: false,
links,
entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links),
totalItems: parseInt(action.payload.headers['x-total-count'], 10)
};
}
case SUCCESS(ACTION_TYPES.FETCH_OPERATION):
return {
...state,
loading: false,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.CREATE_OPERATION):
case SUCCESS(ACTION_TYPES.UPDATE_OPERATION):
return {
...state,
updating: false,
updateSuccess: true,
entity: action.payload.data
return {
...state,
loading: false,
updating: false,
updateSuccess: false,
errorMessage: action.payload
};
case SUCCESS(ACTION_TYPES.SEARCH_WEIGHTS):
case SUCCESS(ACTION_TYPES.FETCH_WEIGHT_LIST):
const links = parseHeaderForLinks(action.payload.headers.link);
return {
...state,
links,
loading: false,
totalItems: action.payload.headers['x-total-count'],
entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links)
};
case SUCCESS(ACTION_TYPES.FETCH_WEIGHT):
return {
...state,
loading: false,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.CREATE_WEIGHT):
case SUCCESS(ACTION_TYPES.UPDATE_WEIGHT):
return {
...state,
updating: false,
updateSuccess: true,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.DELETE_WEIGHT):
return {
...state,
loading: false,
updating: false,
updateSuccess: false,
errorMessage: action.payload
};
case SUCCESS(ACTION_TYPES.SEARCH_BLOODPRESSURES):
case SUCCESS(ACTION_TYPES.FETCH_BLOODPRESSURE_LIST):
const links = parseHeaderForLinks(action.payload.headers.link);
return {
...state,
links,
loading: false,
totalItems: action.payload.headers['x-total-count'],
entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links)
};
case SUCCESS(ACTION_TYPES.FETCH_BLOODPRESSURE):
return {
...state,
loading: false,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.CREATE_BLOODPRESSURE):
case SUCCESS(ACTION_TYPES.UPDATE_BLOODPRESSURE):
return {
...state,
updating: false,
updateSuccess: true,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.DELETE_BLOODPRESSURE):
errorMessage: action.payload
};
case SUCCESS(ACTION_TYPES.SEARCH_WEIGTHS):
return {
...state,
loading: false,
entities: action.payload.data
};
case SUCCESS(ACTION_TYPES.FETCH_WEIGTH_LIST):
const links = parseHeaderForLinks(action.payload.headers.link);
return {
...state,
links,
loading: false,
totalItems: action.payload.headers['x-total-count'],
entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links)
};
case SUCCESS(ACTION_TYPES.FETCH_WEIGTH):
return {
...state,
loading: false,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.CREATE_WEIGTH):
case SUCCESS(ACTION_TYPES.UPDATE_WEIGTH):
return {
...state,
updating: false,
updateSuccess: true,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.DELETE_WEIGTH):
errorMessage: action.payload
};
case SUCCESS(ACTION_TYPES.SEARCH_BLOODPRESSURES):
return {
...state,
loading: false,
entities: action.payload.data
};
case SUCCESS(ACTION_TYPES.FETCH_BLOODPRESSURE_LIST):
const links = parseHeaderForLinks(action.payload.headers.link);
return {
...state,
links,
loading: false,
totalItems: action.payload.headers['x-total-count'],
entities: loadMoreDataWhenScrolled(state.entities, action.payload.data, links)
};
case SUCCESS(ACTION_TYPES.FETCH_BLOODPRESSURE):
return {
...state,
loading: false,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.CREATE_BLOODPRESSURE):
case SUCCESS(ACTION_TYPES.UPDATE_BLOODPRESSURE):
return {
...state,
updating: false,
updateSuccess: true,
entity: action.payload.data
};
case SUCCESS(ACTION_TYPES.DELETE_BLOODPRESSURE):