refactor: handle expire date is null
This commit is contained in:
parent
91586b8e92
commit
f479e6e016
1 changed files with 10 additions and 6 deletions
|
|
@ -1342,9 +1342,11 @@ async function getWorkerFromCriteria(
|
||||||
gender: e.gender,
|
gender: e.gender,
|
||||||
age: calculateAge(e.dateOfBirth),
|
age: calculateAge(e.dateOfBirth),
|
||||||
nationality: optionStore.mapOption(e.nationality),
|
nationality: optionStore.mapOption(e.nationality),
|
||||||
documentExpireDate: e.employeePassport
|
documentExpireDate:
|
||||||
? dateFormat(e.employeePassport[0]?.expireDate) || '-'
|
e.employeePassport !== undefined &&
|
||||||
: '-',
|
e.employeePassport[0]?.expireDate !== undefined
|
||||||
|
? dateFormat(e.employeePassport[0]?.expireDate)
|
||||||
|
: '-',
|
||||||
imgUrl: `${baseUrl}/customer/${e.id}/image/${e.selectedImage}`,
|
imgUrl: `${baseUrl}/customer/${e.id}/image/${e.selectedImage}`,
|
||||||
status: e.status,
|
status: e.status,
|
||||||
}))
|
}))
|
||||||
|
|
@ -1403,9 +1405,11 @@ async function getWorkerFromCriteria(
|
||||||
gender: e.gender,
|
gender: e.gender,
|
||||||
age: calculateAge(e.dateOfBirth),
|
age: calculateAge(e.dateOfBirth),
|
||||||
nationality: optionStore.mapOption(e.nationality),
|
nationality: optionStore.mapOption(e.nationality),
|
||||||
documentExpireDate: e.employeePassport
|
documentExpireDate:
|
||||||
? dateFormat(e.employeePassport[0]?.expireDate) || '-'
|
e.employeePassport !== undefined &&
|
||||||
: '-',
|
e.employeePassport[0]?.expireDate !== undefined
|
||||||
|
? dateFormat(e.employeePassport[0]?.expireDate) || '-'
|
||||||
|
: '-',
|
||||||
imgUrl: `${baseUrl}/customer/${e.id}/image/${e.selectedImage}`,
|
imgUrl: `${baseUrl}/customer/${e.id}/image/${e.selectedImage}`,
|
||||||
status: e.status,
|
status: e.status,
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue