Browse Source

Merge pull request 'Task #860q2vhvg add sync HR' (#8) from dev-wahyu into staging

Reviewed-on: ordo/adw-frontend#8
pull/2/head
ibnu 2 years ago
parent
commit
8ecb48f3db
  1. 1
      src/const/ApiConst.js
  2. 11
      src/views/SimproV2/ResourceWorker/index.js

1
src/const/ApiConst.js

@ -236,6 +236,7 @@ export const TOOLS_CREATE = `${BASE_SIMPRO_LUMEN}/req-tools/create`
export const USER_ADD = `${BASE_SIMPRO_LUMEN}/human-resource/add`
export const USER_SEARCH = `${BASE_SIMPRO_LUMEN}/human-resource/search`
export const USER_LIST = `${BASE_SIMPRO_LUMEN}/human-resource/list`
export const USER_SYNC = `${BASE_SIMPRO_LUMEN}/human-resource/sync`
export const USER_EDIT = (id) => { return `${BASE_SIMPRO_LUMEN}/human-resource/update/${id}` }
export const USER_DELETE = (id) => { return `${BASE_SIMPRO_LUMEN}/human-resource/delete/${id}` }

11
src/views/SimproV2/ResourceWorker/index.js

@ -10,7 +10,7 @@ import { DownloadOutlined } from '@ant-design/icons';
import { NotificationContainer, NotificationManager } from 'react-notifications';
import { Pagination, Table, Button, Tooltip } from 'antd';
import {
PROYEK_SEARCH, USER_ADD, USER_SEARCH, USER_EDIT, USER_DELETE, ROLE_SEARCH, DIVISI_SEARCH, USER_SHIFT_ADD
PROYEK_SEARCH, USER_ADD, USER_SEARCH, USER_EDIT, USER_DELETE, ROLE_SEARCH, DIVISI_SEARCH, USER_SHIFT_ADD, USER_SYNC
} from '../../../const/ApiConst';
import { useTranslation } from 'react-i18next';
const url = "";
@ -229,6 +229,12 @@ const ResourceWorker = ({ params }) => {
}
const handleSync = async () => {
await axios.get(USER_SYNC, HEADER)
.then(res => res)
.catch((error)=>error.response)
}
const handleExportExcel = async () => {
let start = 0;
@ -554,6 +560,9 @@ const ResourceWorker = ({ params }) => {
<Col>
<Tooltip title={t('hradd')}>
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button>
</Tooltip>
<Tooltip title="HR Sync">
<Button style={{ background: "#007bff ", color: "#fff", marginLeft: "5px" }} onClick={() => handleSync()}><i className="fa fa-spinner"></i></Button>
</Tooltip>
<Tooltip title={t('exportExcel')}>
<Button style={{ marginLeft: "5px" }} onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button>

Loading…
Cancel
Save