Merge branch 'feat/socket-message-type' into develop
This commit is contained in:
commit
65ba3c73e2
1 changed files with 11 additions and 0 deletions
|
|
@ -126,6 +126,7 @@ async function handler(msg: amqp.ConsumeMessage): Promise<boolean> {
|
||||||
sendWebSocket(
|
sendWebSocket(
|
||||||
"send-command-notification",
|
"send-command-notification",
|
||||||
{
|
{
|
||||||
|
success: true,
|
||||||
message: `ระบบทำการออกคำสั่งเลขที่ ${command.commandNo}/${command.commandYear + 543}`,
|
message: `ระบบทำการออกคำสั่งเลขที่ ${command.commandNo}/${command.commandYear + 543}`,
|
||||||
payload: command,
|
payload: command,
|
||||||
},
|
},
|
||||||
|
|
@ -169,6 +170,7 @@ async function handler(msg: amqp.ConsumeMessage): Promise<boolean> {
|
||||||
sendWebSocket(
|
sendWebSocket(
|
||||||
"send-command-notification",
|
"send-command-notification",
|
||||||
{
|
{
|
||||||
|
success: true,
|
||||||
message: `ระบบออกคำสั่งเลขที่ ${command.commandNo}/${command.commandYear + 543} เสร็จสิ้น`,
|
message: `ระบบออกคำสั่งเลขที่ ${command.commandNo}/${command.commandYear + 543} เสร็จสิ้น`,
|
||||||
payload: command,
|
payload: command,
|
||||||
},
|
},
|
||||||
|
|
@ -179,6 +181,15 @@ async function handler(msg: amqp.ConsumeMessage): Promise<boolean> {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
sendWebSocket(
|
||||||
|
"send-command-notification",
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: `ระบบออกคำสั่งเลขที่ ${command.commandNo}/${command.commandYear + 543} ผิดพลาด`,
|
||||||
|
payload: command,
|
||||||
|
},
|
||||||
|
{ userId: user.sub },
|
||||||
|
).catch(console.error);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue