เพิ่มแนบไฟล์คำสั่งในรายการแจ้งเตือน #1784

This commit is contained in:
Bright 2025-08-29 11:29:31 +07:00
parent ef7a8bc0e8
commit 35eec3a5f5
2 changed files with 25 additions and 2 deletions

View file

@ -561,6 +561,27 @@ export function chunkArray(array: any, size: number) {
return result;
}
export async function PayloadSendNoti(commandId: string) {
if (!commandId)
return "";
const commandRepository = AppDataSource.getRepository(Command);
const _command = await commandRepository.findOne({
where: {
id: commandId,
},
relations: ["commandType"],
});
const _payload = {
name: _command && _command.commandType
? `คำสั่ง${_command.commandType.name}`
: "",
url: `${process.env.API_URL}/salary/file/ระบบออกคำสั่ง/คำสั่ง/${commandId}/คำสั่ง`,
isReport: true,
isTemplate: false,
}
return JSON.stringify(_payload);
}
export function commandTypePath(commandCode: string): string | null {
switch (commandCode) {
case "C-PM-01":