fix: ไฟล์แนบท้ายดาวน์โหลดไม่ได้
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m20s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m20s
This commit is contained in:
parent
74b2694aef
commit
a16ae79c7e
1 changed files with 9 additions and 10 deletions
|
|
@ -601,7 +601,7 @@ export async function PayloadSendNoti(commandId: string) {
|
|||
where: {
|
||||
id: commandId,
|
||||
},
|
||||
relations: ["commandType"],
|
||||
relations: ["commandType", "commandRecives"],
|
||||
});
|
||||
if (!_command || !_command.commandType)
|
||||
return "";
|
||||
|
|
@ -615,19 +615,18 @@ export async function PayloadSendNoti(commandId: string) {
|
|||
}
|
||||
let attachments = {}
|
||||
if (_command.commandType.isUploadAttachment === true) {
|
||||
const _payloadAtt = {
|
||||
name: _command && _command.commandType
|
||||
? `เอกสารแนบท้ายคำสั่ง${_command.commandType.name}`
|
||||
: "",
|
||||
url: `${process.env.API_URL}/salary/file/ระบบออกคำสั่ง/แนบท้าย/${commandId}/แนบท้าย`,
|
||||
|
||||
const attachmentPayloads = _command.commandRecives.map((recive: any) => ({
|
||||
name: `เอกสารแนบท้ายคำสั่ง${_command.commandType.name} (${recive.prefix}${recive.firstName} ${recive.lastName})`,
|
||||
url: `${process.env.API_URL}/salary/file/ระบบออกคำสั่ง/แนบท้าย/${commandId}/${recive.citizenId}/แนบท้าย`,
|
||||
isReport: true,
|
||||
isTemplate: false,
|
||||
}
|
||||
}));
|
||||
|
||||
attachments = {
|
||||
attachments: [_payload, _payloadAtt]
|
||||
attachments: [_payload, ...attachmentPayloads]
|
||||
};
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
attachments = {
|
||||
attachments: [_payload]
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue