working employee and price selector
This commit is contained in:
65
src/actions/cShift/reducer.actions.js
Normal file
65
src/actions/cShift/reducer.actions.js
Normal file
@@ -0,0 +1,65 @@
|
||||
import {
|
||||
IS_SENDING_CSHIFT_REQUEST,
|
||||
SET_CSHIFT_REQUEST_ERROR,
|
||||
CLEAR_CSHIFT_REQUEST_ERROR,
|
||||
SET_CSHIFT_REQUEST_SUCCESS,
|
||||
CLEAR_CSHIFT_REQUEST_SUCCESS,
|
||||
SET_FORM_EMPLOYEE_UUID,
|
||||
SET_FORM_PRICE_UUID,
|
||||
SET_CLEAR_CSHIFT_STATE
|
||||
} from "../../constants/cShift.constants";
|
||||
import { parseError } from "../common.actions";
|
||||
|
||||
export function isSendingCShiftRequest(sendingRequest) {
|
||||
return {
|
||||
type: IS_SENDING_CSHIFT_REQUEST,
|
||||
data: sendingRequest
|
||||
};
|
||||
}
|
||||
|
||||
export function setCShiftRequestError(exception) {
|
||||
let error = parseError(exception);
|
||||
return {
|
||||
type: SET_CSHIFT_REQUEST_ERROR,
|
||||
data: error
|
||||
};
|
||||
}
|
||||
|
||||
export function clearCShiftRequestError() {
|
||||
return {
|
||||
type: CLEAR_CSHIFT_REQUEST_ERROR
|
||||
};
|
||||
}
|
||||
|
||||
export function setCShiftRequestSuccess(response) {
|
||||
return {
|
||||
type: SET_CSHIFT_REQUEST_SUCCESS,
|
||||
data: response.detail || response
|
||||
};
|
||||
}
|
||||
|
||||
export function clearCShiftRequestSuccess() {
|
||||
return {
|
||||
type: CLEAR_CSHIFT_REQUEST_SUCCESS
|
||||
};
|
||||
}
|
||||
|
||||
export function setFormEmployeeUUID(uuid) {
|
||||
return {
|
||||
type: SET_FORM_EMPLOYEE_UUID,
|
||||
data: uuid
|
||||
};
|
||||
}
|
||||
|
||||
export function setFormPriceUUID(uuid) {
|
||||
return {
|
||||
type: SET_FORM_PRICE_UUID,
|
||||
data: uuid
|
||||
};
|
||||
}
|
||||
|
||||
export function setClearCshiftState() {
|
||||
return {
|
||||
type: SET_CLEAR_CSHIFT_STATE
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user