Commit 952dcca9 authored by Deni Rinaldi's avatar Deni Rinaldi

sorting unitbisnis

parent 48b74075
......@@ -50,12 +50,14 @@ export default class UnitBisnis extends Component {
let isi = resp.rows.slice(3)
let payload = []
isi.map((item, index) => {
payload.push({
id: index + 1,
business_unit_name: item[0],
start_date: item[1],
end_date: item[2],
})
if (item.length > 0) {
payload.push({
id: index + 1,
business_unit_name: item[0],
start_date: item[1],
end_date: item[2],
})
}
})
let body = {
business_unit: payload
......@@ -170,8 +172,6 @@ export default class UnitBisnis extends Component {
})
// console.log(JSON.stringify(payload));
}
});
}
......@@ -185,7 +185,7 @@ export default class UnitBisnis extends Component {
console.log(response)
if (response.data.status == 'success') {
let data = response.data.data
let listData = data.map((item, index) => {
let listData = data.sort((a,b) => a.business_unit_id - b.business_unit_id).map((item, index) => {
return [index, item.business_unit_id, item.business_unit_name, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data })
......@@ -287,7 +287,7 @@ export default class UnitBisnis extends Component {
this.setState({ visibleUnitBisnis: true })
})
}
render() {
const columns = [{
name: "Action",
......
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