import { IS_SENDING_PSHIFT_REQUEST, SET_PSHIFT_REQUEST_SUCCESS, SET_PSHIFT_REQUEST_ERROR, CLEAR_PSHIFT_REQUEST_ERROR, CLEAR_PSHIFT_REQUEST_SUCCESS, SET_FORM_SHIFT_CHART, SET_PSHIFT_PAGE, SET_PSHIFT_APPROVAL_FILTER, SET_PSHIFT_COMPLETED_FILTER, SET_PSHIFT_CLIENT_FILTER, SET_PSHIFT_WORKTYPE_FILTER, 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 }; } export function setFormShiftChart(chart) { return { type: SET_FORM_SHIFT_CHART, data: chart }; } export function setPShiftPage(page) { return { type: SET_PSHIFT_PAGE, data: page }; } export function setPShiftApprovalFilter(approvalFilter) { return { type: SET_PSHIFT_APPROVAL_FILTER, data: approvalFilter }; } export function setPShiftCompletedFilter(completedFilter) { return { type: SET_PSHIFT_COMPLETED_FILTER, data: completedFilter }; } export function setPShiftClientFilter(clientFilter) { return { type: SET_PSHIFT_CLIENT_FILTER, data: clientFilter }; } export function setPShiftWorkTypeFilter(workTypeFilter) { return { type: SET_PSHIFT_WORKTYPE_FILTER, data: workTypeFilter }; } export function setClearPShiftState() { return { type: SET_CLEAR_PSHIFT_STATE }; }