From 2bb44003c01c019430ea805b9f41ac020cff3ea0 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 1 Sep 2025 13:47:27 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=81=E0=B8=88=E0=B9=89=E0=B8=87=E0=B9=80=E0=B8=95?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B9=81=E0=B8=99=E0=B8=9A=E0=B9=80=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=AA=E0=B8=B2=E0=B8=A3=E0=B9=81=E0=B8=99=E0=B8=9A=E0=B8=97?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=A2=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interfaces/utils.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/interfaces/utils.ts b/src/interfaces/utils.ts index cbd1b00b..cf86f369 100644 --- a/src/interfaces/utils.ts +++ b/src/interfaces/utils.ts @@ -581,9 +581,25 @@ export async function PayloadSendNoti(commandId: string) { isReport: true, isTemplate: false, } - const attachments = { - attachments: [_payload] - }; + let attachments = {} + if (_command.commandType.isUploadAttachment === true) { + const _payloadAtt = { + name: _command && _command.commandType + ? `เอกสารแนบท้ายคำสั่ง${_command.commandType.name}` + : "", + url: `${process.env.API_URL}/salary/file/ระบบออกคำสั่ง/แนบท้าย/${commandId}/แนบท้าย`, + isReport: true, + isTemplate: false, + } + attachments = { + attachments: [_payload, _payloadAtt] + }; + } + else { + attachments = { + attachments: [_payload] + }; + } return JSON.stringify(attachments); }