You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.4 KiB
73 lines
1.4 KiB
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 |
|
}; |
|
}
|
|
|