functionality for client users to add providers
This commit is contained in:
73
src/actions/employee/reducer.actions.js
Normal file
73
src/actions/employee/reducer.actions.js
Normal file
@@ -0,0 +1,73 @@
|
||||
import {
|
||||
IS_SENDING_EMPLOYEE_REQUEST,
|
||||
SET_EMPLOYEE_REQUEST_ERROR,
|
||||
CLEAR_EMPLOYEE_REQUEST_ERROR,
|
||||
SET_EMPLOYEE_REQUEST_SUCCESS,
|
||||
CLEAR_EMPLOYEE_REQUEST_SUCCESS,
|
||||
SET_EMPLOYEE_UUID,
|
||||
SET_FORM_EMPLOYEE_EMAIL,
|
||||
SET_FORM_EMPLOYEE_NOTE,
|
||||
SET_CLEAR_EMPLOYEE_STATE
|
||||
} from "../../constants/employee.constants";
|
||||
import { parseError } from "../common.actions";
|
||||
|
||||
export function isSendingEmployeeRequest(sendingRequest) {
|
||||
return {
|
||||
type: IS_SENDING_EMPLOYEE_REQUEST,
|
||||
data: sendingRequest
|
||||
};
|
||||
}
|
||||
|
||||
export function setEmployeeRequestError(exception) {
|
||||
let error = parseError(exception);
|
||||
return {
|
||||
type: SET_EMPLOYEE_REQUEST_ERROR,
|
||||
data: error
|
||||
};
|
||||
}
|
||||
|
||||
export function clearEmployeeRequestError() {
|
||||
return {
|
||||
type: CLEAR_EMPLOYEE_REQUEST_ERROR
|
||||
};
|
||||
}
|
||||
|
||||
export function setEmployeeRequestSuccess(response) {
|
||||
return {
|
||||
type: SET_EMPLOYEE_REQUEST_SUCCESS,
|
||||
data: response.detail || response
|
||||
};
|
||||
}
|
||||
|
||||
export function clearEmployeeRequestSuccess() {
|
||||
return {
|
||||
type: CLEAR_EMPLOYEE_REQUEST_SUCCESS
|
||||
};
|
||||
}
|
||||
|
||||
export function setEmployeeUUID(uuid) {
|
||||
return {
|
||||
type: SET_EMPLOYEE_UUID,
|
||||
data: uuid
|
||||
}
|
||||
}
|
||||
|
||||
export function setFormEmployeeEmail(email) {
|
||||
return {
|
||||
type: SET_FORM_EMPLOYEE_EMAIL,
|
||||
data: email
|
||||
};
|
||||
}
|
||||
|
||||
export function setFormEmployeeNote(note) {
|
||||
return {
|
||||
type: SET_FORM_EMPLOYEE_NOTE,
|
||||
data: note
|
||||
};
|
||||
}
|
||||
|
||||
export function setClearEmployeeState() {
|
||||
return {
|
||||
type: SET_CLEAR_EMPLOYEE_STATE
|
||||
};
|
||||
}
|
26
src/actions/employee/saga.actions.js
Normal file
26
src/actions/employee/saga.actions.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
CREATE_EMPLOYEE_REQUEST,
|
||||
READ_EMPLOYEE_REQUEST,
|
||||
DELETE_EMPLOYEE_REQUEST
|
||||
} from "../../constants/employee.constants";
|
||||
|
||||
export function createEmployeeRequest(postBody) {
|
||||
return {
|
||||
type: CREATE_EMPLOYEE_REQUEST,
|
||||
data: postBody
|
||||
};
|
||||
}
|
||||
|
||||
export function readEmployeeRequest(payload) {
|
||||
return {
|
||||
type: READ_EMPLOYEE_REQUEST,
|
||||
data: payload
|
||||
};
|
||||
}
|
||||
|
||||
export function deleteEmployeeRequest(payload) {
|
||||
return {
|
||||
type: DELETE_EMPLOYEE_REQUEST,
|
||||
data: payload
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user