functionality for client users to add providers

This commit is contained in:
Alexander Wong
2018-01-21 15:23:50 -07:00
parent 95d86161ec
commit bc0628bcb7
14 changed files with 596 additions and 16 deletions

View 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
};
}

View 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
};
}