Files
pedwfrontend/store/currentView/action.js
T
2022-12-16 11:36:01 +00:00

83 lines
2.6 KiB
JavaScript

export const currentViewActionTypes = {
GETCURRENTVIEW: "GETCURRENTVIEW",
SETCURRENTVIEW: "SETCURRENTVIEW",
SETCURRENTREFERENCE: "SETCURRENTREFERENCE",
SETREPRESENTATIONCAPACITY: "SETREPRESENTATIONCAPACITY",
SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT",
SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION",
SETCURRENTLINKEDCASES: "SETCURRENTLINKEDCASES",
SETCURRENTPAGE: "SETCURRENTPAGE",
SETSHOWREPS: "SETSHOWREPS",
};
export const getCurrentViewObj = () => (dispatch) => {
return dispatch({
type: currentViewActionTypes.GETCURRENTVIEW,
});
};
export const setCurrentView = (currentView) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETCURRENTVIEW,
currentView: currentView,
});
};
export const setCurrentReference = (caseReference) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETCURRENTREFERENCE,
caseReference: caseReference,
});
};
export const setRepresentationCapacity =
(representationCapacity) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONCAPACITY,
representationCapacity: representationCapacity,
});
};
export const setRepresentationSubmit = (representationSubmit) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONSUBMIT,
representationSubmit: representationSubmit,
});
};
export const setSubmitBack = (representationSubmit) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONSUBMIT,
representationSubmit: representationSubmit,
});
};
export const setRepresentationSubmitConfirmation =
(representationSubmitConfirmation) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONSUBMITCONFIRMATION,
representationSubmitConfirmation: representationSubmitConfirmation,
});
};
export const setCurrentLinkedCases = (linkedCaseReferences) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETCURRENTLINKEDCASES,
linkedCaseReferences: linkedCaseReferences,
});
};
export const setCurrentPage = (currentPage) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETCURRENTPAGE,
currentPage: currentPage,
});
};
export const setShowReps = (showReps) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETSHOWREPS,
showReps: showReps,
});
};