|
|
|
@ -125,11 +125,13 @@ const MasterCompany = ({ params }) => {
|
|
|
|
|
.then(res => res) |
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
const sourceData = result.data.data; |
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
const sourceData = result.data.data; |
|
|
|
|
const countRecord = result.data.totalRecord; |
|
|
|
|
|
|
|
|
|
setDatatable(sourceData); |
|
|
|
|
setTotalPage(result.data.totalRecord); |
|
|
|
|
const lastCompanyId = sourceData[sourceData.length - 1].id; |
|
|
|
|
setTotalPage(countRecord); |
|
|
|
|
const lastCompanyId = countRecord > 0 ? sourceData[sourceData.length - 1].id : null; |
|
|
|
|
setLastCompanyId(lastCompanyId); |
|
|
|
|
setLoading(false) |
|
|
|
|
} else { |
|
|
|
@ -187,7 +189,7 @@ const MasterCompany = ({ params }) => {
|
|
|
|
|
const sourceData = result.data.data; |
|
|
|
|
setProjectImageSlider(sourceData); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleSearch = e => { |
|
|
|
|
const value = e.target.value |
|
|
|
|