|
|
@ -127,9 +127,11 @@ const MasterCompany = ({ params }) => { |
|
|
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
const sourceData = result.data.data; |
|
|
|
const sourceData = result.data.data; |
|
|
|
|
|
|
|
const countRecord = result.data.totalRecord; |
|
|
|
|
|
|
|
|
|
|
|
setDatatable(sourceData); |
|
|
|
setDatatable(sourceData); |
|
|
|
setTotalPage(result.data.totalRecord); |
|
|
|
setTotalPage(countRecord); |
|
|
|
const lastCompanyId = sourceData[sourceData.length - 1].id; |
|
|
|
const lastCompanyId = countRecord > 0 ? sourceData[sourceData.length - 1].id : null; |
|
|
|
setLastCompanyId(lastCompanyId); |
|
|
|
setLastCompanyId(lastCompanyId); |
|
|
|
setLoading(false) |
|
|
|
setLoading(false) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|