This commit is contained in:
JOSEPH LE 2024-05-14 14:50:00 +07:00
parent d6482d4f60
commit 929c2368aa
1 changed files with 12 additions and 1 deletions

View File

@ -61,7 +61,18 @@ const Tracking = () => {
const getAllTracking = async () =>{
try {
const res = await get(getListTracking)
const searchParams = new URLSearchParams(window.location.search)
const params = {}
for (const [key, value] of searchParams.entries()) {
if (key === 'page' && value === '') {
Object.assign(params, { [`${key}`]: 1 })
} else {
Object.assign(params, { [`${key}`]: value })
}
}
const res = await get(getListTracking, params)
if(res.status){
setListTracking(res)
}