|
|
@ -10,7 +10,7 @@ import { PROJECT_ROLE_ADD, PROJECT_ROLE_SEARCH, PROJECT_ROLE_EDIT, PROJECT_ROLE_ |
|
|
|
import { Pagination, Tooltip, Table } from 'antd'; |
|
|
|
import { Pagination, Tooltip, Table } from 'antd'; |
|
|
|
import { withTranslation } from 'react-i18next'; |
|
|
|
import { withTranslation } from 'react-i18next'; |
|
|
|
const token = window.localStorage.getItem('token'); |
|
|
|
const token = window.localStorage.getItem('token'); |
|
|
|
|
|
|
|
const company_id = localStorage.getItem("company_id") |
|
|
|
const BASE_URL = "http://siopas.co.id/custom-php/api/geohr/"; |
|
|
|
const BASE_URL = "http://siopas.co.id/custom-php/api/geohr/"; |
|
|
|
|
|
|
|
|
|
|
|
const config = { |
|
|
|
const config = { |
|
|
@ -60,6 +60,7 @@ class index extends Component { |
|
|
|
tooltipTambah: false, |
|
|
|
tooltipTambah: false, |
|
|
|
totalPage: 0, |
|
|
|
totalPage: 0, |
|
|
|
typeDialog: 'Save', |
|
|
|
typeDialog: 'Save', |
|
|
|
|
|
|
|
company_id |
|
|
|
} |
|
|
|
} |
|
|
|
this.columns = [ |
|
|
|
this.columns = [ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -108,7 +109,8 @@ class index extends Component { |
|
|
|
const formData = { |
|
|
|
const formData = { |
|
|
|
"paging": { "start": start, "length": this.state.rowsPerPage }, |
|
|
|
"paging": { "start": start, "length": this.state.rowsPerPage }, |
|
|
|
"columns": [ |
|
|
|
"columns": [ |
|
|
|
{ "name": "name", "logic_operator": "ilike", "value": this.state.search, "operator": "AND" } |
|
|
|
{ "name": "name", "logic_operator": "ilike", "value": this.state.search, "operator": "AND" }, |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": this.state.company_id, "operator": "AND" } |
|
|
|
], |
|
|
|
], |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
@ -178,7 +180,8 @@ class index extends Component { |
|
|
|
|
|
|
|
|
|
|
|
const formData = { |
|
|
|
const formData = { |
|
|
|
name: data.name, |
|
|
|
name: data.name, |
|
|
|
description: data.description |
|
|
|
description: data.description, |
|
|
|
|
|
|
|
company_id |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios.post(PROJECT_ROLE_ADD, formData, config) |
|
|
|
const result = await axios.post(PROJECT_ROLE_ADD, formData, config) |
|
|
@ -198,7 +201,8 @@ class index extends Component { |
|
|
|
|
|
|
|
|
|
|
|
const formData = { |
|
|
|
const formData = { |
|
|
|
name: data.name, |
|
|
|
name: data.name, |
|
|
|
description: data.description |
|
|
|
description: data.description, |
|
|
|
|
|
|
|
company_id |
|
|
|
} |
|
|
|
} |
|
|
|
const url = PROJECT_ROLE_EDIT(data.id) |
|
|
|
const url = PROJECT_ROLE_EDIT(data.id) |
|
|
|
const result = await axios.put(url, formData, config) |
|
|
|
const result = await axios.put(url, formData, config) |
|
|
|