added pShift scaffolding
This commit is contained in:
49
src/actions/pShift/reducer.actions.js
Normal file
49
src/actions/pShift/reducer.actions.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import {
|
||||
IS_SENDING_PSHIFT_REQUEST,
|
||||
SET_PSHIFT_REQUEST_SUCCESS,
|
||||
SET_PSHIFT_REQUEST_ERROR,
|
||||
CLEAR_PSHIFT_REQUEST_ERROR,
|
||||
CLEAR_PSHIFT_REQUEST_SUCCESS,
|
||||
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 setClearPShiftState() {
|
||||
return {
|
||||
type: SET_CLEAR_PSHIFT_STATE
|
||||
};
|
||||
}
|
8
src/actions/pShift/saga.actions.js
Normal file
8
src/actions/pShift/saga.actions.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { GET_PSHIFTS_REQUEST } from "../../constants/pShift.constants";
|
||||
|
||||
export function getPShiftsRequest(params) {
|
||||
return {
|
||||
type: GET_PSHIFTS_REQUEST,
|
||||
data: params
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user