Commit 8b97e209 authored by faisalhamdi's avatar faisalhamdi

update parameter

parent ec6fb43a
...@@ -83,6 +83,9 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') ...@@ -83,6 +83,9 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
const updateUnitBisnis = (body) => api.post('/business_unit/update_business_unit', body) const updateUnitBisnis = (body) => api.post('/business_unit/update_business_unit', body)
const searchUnitBisnis = (body) => api.post('/business_unit/search_business_unit', body) const searchUnitBisnis = (body) => api.post('/business_unit/search_business_unit', body)
// Perusahaan
const getCompany = () => api.get('company/get_all_company')
// ------ // ------
// STEP 3 // STEP 3
// ------ // ------
...@@ -111,7 +114,8 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') ...@@ -111,7 +114,8 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
getUnitBisnis, getUnitBisnis,
createUnitBisnis, createUnitBisnis,
updateUnitBisnis, updateUnitBisnis,
searchUnitBisnis searchUnitBisnis,
getCompany
} }
} }
......
...@@ -7,6 +7,7 @@ import MUIDataTable from "mui-datatables"; ...@@ -7,6 +7,7 @@ import MUIDataTable from "mui-datatables";
import { render } from '@testing-library/react'; import { render } from '@testing-library/react';
import { TextField, InputBase } from "@material-ui/core"; import { TextField, InputBase } from "@material-ui/core";
import CreatePerusahaan from "../Perusahaan/CreatePerusahaan"; import CreatePerusahaan from "../Perusahaan/CreatePerusahaan";
import api from "../../../api";
var ct = require("../../../library/CustomTable"); var ct = require("../../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -23,6 +24,22 @@ export default class Perusahaan extends Component { ...@@ -23,6 +24,22 @@ export default class Perusahaan extends Component {
} }
componentDidMount() { componentDidMount() {
this.getData()
}
getData() {
api.create().getCompany().then((response) => {
console.log(response)
if (response.data.status == 'success') {
let data = response.data.data
let listData = data.map((item, index) => {
return [index, item.business_unit_id, item.business_unit_name, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data })
} else {
alert(response.data.message)
}
})
} }
render() { render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment