no message
This commit is contained in:
parent
08706f57ed
commit
049a0299de
1 changed files with 33 additions and 0 deletions
|
|
@ -156,6 +156,39 @@ export class WorkflowController extends Controller {
|
|||
}),
|
||||
);
|
||||
|
||||
const _workflow = await this.workflowRepo.findOne({
|
||||
where: { id: workflow.id },
|
||||
relations: ["stateOperatorUsers"],
|
||||
});
|
||||
if (!_workflow) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่สามารถดำเนินการกระบวนการนี้ได้");
|
||||
|
||||
const _state = await this.stateRepo.findOne({
|
||||
where: {
|
||||
id: _workflow.stateId,
|
||||
},
|
||||
relations: ["stateOperators"],
|
||||
});
|
||||
if (!_state) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลขั้นตอนการอนุมัติ");
|
||||
let profileNow = _workflow.stateOperatorUsers
|
||||
.filter((x) => _state.stateOperators.map((s) => s.operator).includes(x.operator))
|
||||
.map((x) => ({
|
||||
receiverUserId: x.profile,
|
||||
notiLink: "",
|
||||
}));
|
||||
await new CallAPI()
|
||||
.PostData(req, "/placement/noti/profiles", {
|
||||
subject: `รายการถูกส่ง`,
|
||||
body: `รายการถูกส่ง`,
|
||||
receiverUserIds: profileNow,
|
||||
payload: "", //แนบไฟล์
|
||||
isSendMail: true,
|
||||
isSendInbox: true,
|
||||
isSendNotification: true,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error calling API:", error);
|
||||
});
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue