Refactoring code module 01_metadata => 02_position
This commit is contained in:
parent
3b9df73811
commit
a8d794abe6
15 changed files with 1188 additions and 1436 deletions
|
|
@ -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;
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue