เฉพาะคำสั่ง C-PM-10 ให้ตัด profilesNotiRequest ที่ส่ง noti ครั้งแรกออก เพราะ UI ปิด Tab นี้
This commit is contained in:
parent
4ba71ff830
commit
4bdf1ad7b4
1 changed files with 8 additions and 6 deletions
|
|
@ -445,11 +445,6 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise<boolean>
|
|||
isSendNotification: true,
|
||||
}))
|
||||
: [];
|
||||
/*เฉพาะคำสั่ง C-PM-10 ให้ตัด receiverUserId ที่ส่ง noti ครั้งแรกออก*/
|
||||
if (command && command.commandType && ["C-PM-10"].includes(command.commandType.code)) {
|
||||
const firstNotiIds = profiles.map((p:any) => p.receiverUserId);
|
||||
profilesSend = profilesSend.filter((x:any) => !firstNotiIds.includes(x.receiverUserId));
|
||||
}
|
||||
const payloadStr = await PayloadSendNoti(command.id);
|
||||
const profilesSendRequest = new CallAPI()
|
||||
.PostData(
|
||||
|
|
@ -479,7 +474,14 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise<boolean>
|
|||
console.error("Full error object:", error);
|
||||
});
|
||||
|
||||
await Promise.all([profilesNotiRequest, profilesSendRequest]);
|
||||
/*เฉพาะคำสั่ง C-PM-10 ให้ตัด profilesNotiRequest ที่ส่ง noti ครั้งแรกออก*/
|
||||
if (command && command.commandType && ["C-PM-10"].includes(command.commandType.code)) {
|
||||
await Promise.all([profilesSendRequest]);
|
||||
}
|
||||
else {
|
||||
await Promise.all([profilesNotiRequest, profilesSendRequest]);
|
||||
}
|
||||
|
||||
|
||||
console.log("[AMQ] Send Notification Success");
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue