Browse Source

integration human resource

pull/2/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
af59baf790
  1. 6
      src/const/ApiConst.js
  2. 14
      src/views/SimproV2/CreatedProyek/AsignHrProject.js
  3. 1
      src/views/SimproV2/CreatedProyek/DialogFormResource.js

6
src/const/ApiConst.js

@ -1,10 +1,10 @@
import { appConfig, MAP_ID } from './MapConst'; import { appConfig, MAP_ID } from './MapConst';
const roleName = window.localStorage.getItem('role_name'); const roleName = window.localStorage.getItem('role_name');
const HOST = "https://osmap.id"; // online const HOST = "https://osmap.id"; // online
export const API_ADW = "http://ospro-api.adyawinsa.com:9083/api/";
export const TOKEN_ADW = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjAyIiwiZXhwIjoxNjkxODMwNDkzfQ.DvBQIOZsdFndWsliPCZT65Y6G5Xx4vWBKz8Rhe7rvRA";
export const BASE_URL_GEOHR_API = "https://oslog.id/geohr-api"; export const BASE_URL_GEOHR_API = "https://oslog.id/geohr-api";
export const BASE_URL_GEOHR_API2 = "http://siopas.co.id/custom-php/api/geohr"; export const BASE_URL_GEOHR_API2 = "http://siopas.co.id/custom-php/api/geohr";

14
src/views/SimproV2/CreatedProyek/AsignHrProject.js

@ -4,7 +4,7 @@ import { Button, Form } from 'reactstrap';
import { Table, Tooltip } from 'antd'; import { Table, Tooltip } from 'antd';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
import moment from 'moment'; import moment from 'moment';
import { ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_DELETE, USER_LIST, PROJECT_ROLE_SEARCH, ASSIGN_HR_PROJECT_ADD, ASSIGN_HR_PROJECT_EDIT } from '../../../const/ApiConst'; import { API_ADW, TOKEN_ADW, ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_DELETE, USER_LIST, PROJECT_ROLE_SEARCH, ASSIGN_HR_PROJECT_ADD, ASSIGN_HR_PROJECT_EDIT } from '../../../const/ApiConst';
import axios from "../../../const/interceptorApi" import axios from "../../../const/interceptorApi"
import { NotificationContainer, NotificationManager } from 'react-notifications'; import { NotificationContainer, NotificationManager } from 'react-notifications';
import SweetAlert from 'react-bootstrap-sweetalert'; import SweetAlert from 'react-bootstrap-sweetalert';
@ -75,15 +75,19 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
} }
const getDataUser = async () => { const getDataUser = async () => {
const HEADER_ADW = {
headers: {
"Authorization": `${TOKEN_ADW}`
}
}
const result = await axios const result = await axios
.get(USER_LIST, HEADER) .get(`${API_ADW}employees`, HEADER_ADW)
// .get(USER_LIST, HEADER)
.then(res => res) .then(res => res)
.catch((error) => error.response); .catch((error) => error.response);
if (result && result.data && result.data.data.length != 0) {
if (result && result.data && result.data.code == 200) {
let dataRes = result.data.data let dataRes = result.data.data
setListUser(dataRes) setListUser(dataRes)
} else {
} }
} }

1
src/views/SimproV2/CreatedProyek/DialogFormResource.js

@ -110,7 +110,6 @@ const DialogFormResource = ({ openDialog, closeDialog, toggleDialog, idTask, use
.catch((error) => error.response); .catch((error) => error.response);
if (result && result.data && result.data.code == 200) { if (result && result.data && result.data.code == 200) {
console.log("cek user resource", result.data.data)
let dataRes = result.data.data || [] let dataRes = result.data.data || []
setUserToProyek(dataRes); setUserToProyek(dataRes);

Loading…
Cancel
Save