Refactoring code module 01_metadata => 02_position

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-05 14:14:15 +07:00
parent 3b9df73811
commit a8d794abe6
15 changed files with 1188 additions and 1436 deletions

View file

@ -98,27 +98,28 @@ async function getDataNotification(index: number, type: string) {
};
await http
.get(config.API.msgNotificate + `?page=${index}&pageSize=${10}`)
.then((res: any) => {
.then((res) => {
const response = res.data.result.data;
totalInbox.value = res.data.result.total;
let list: notiType[] = [];
if (type === "DEL") {
notiList.value = [];
}
response.map((e: any) => {
list.push({
id: e.id,
sender:
e.createdFullName == "" || e.createdFullName == null
? "เจ้าหน้าที่"[0]
: e.createdFullName[0],
body: e.body ?? "",
timereceive: `${date2Thai(e.receiveDate)} ${new Date(
e.receiveDate
).toLocaleTimeString("th-TH", thaiOptions)} .`,
isOpen: e.isOpen,
response &&
response.map((e: any) => {
list.push({
id: e.id,
sender:
e.createdFullName == "" || e.createdFullName == null
? "เจ้าหน้าที่"[0]
: e.createdFullName[0],
body: e.body ?? "",
timereceive: `${date2Thai(e.receiveDate)} ${new Date(
e.receiveDate
).toLocaleTimeString("th-TH", thaiOptions)} .`,
isOpen: e.isOpen,
});
});
});
notiList.value.push(...list);
statusLoad.value = totalInbox.value === 0 ? true : false;
})