caremyway-client/src/actions/pShift/reducer.actions.js

58 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-04-23 05:04:09 +00:00
import {
IS_SENDING_PSHIFT_REQUEST,
SET_PSHIFT_REQUEST_SUCCESS,
SET_PSHIFT_REQUEST_ERROR,
CLEAR_PSHIFT_REQUEST_ERROR,
CLEAR_PSHIFT_REQUEST_SUCCESS,
2018-04-23 18:19:14 +00:00
SET_FORM_SHIFT_CHART,
2018-04-23 05:04:09 +00:00
SET_CLEAR_PSHIFT_STATE
} from "../../constants/pShift.constants";
import { parseError } from "../common.actions";
export function isSendingPShiftRequest(sendingRequest) {
return {
type: IS_SENDING_PSHIFT_REQUEST,
data: sendingRequest
};
}
export function setPShiftRequestSuccess(response) {
return {
type: SET_PSHIFT_REQUEST_SUCCESS,
data: response.detail || response
};
}
export function setPShiftRequestError(exception) {
let error = parseError(exception);
return {
type: SET_PSHIFT_REQUEST_ERROR,
data: error
};
}
export function clearPShiftRequestError() {
return {
type: CLEAR_PSHIFT_REQUEST_ERROR
};
}
export function clearPShiftRequestSuccess() {
return {
type: CLEAR_PSHIFT_REQUEST_SUCCESS
};
}
2018-04-23 18:19:14 +00:00
export function setFormShiftChart(chart) {
return {
type: SET_FORM_SHIFT_CHART,
data: chart
};
}
2018-04-23 05:04:09 +00:00
export function setClearPShiftState() {
return {
type: SET_CLEAR_PSHIFT_STATE
};
}