เพิ่ม noti
This commit is contained in:
parent
0269036af7
commit
3871ec5f9f
3 changed files with 40 additions and 5 deletions
|
|
@ -895,6 +895,24 @@ export class CommandController extends Controller {
|
|||
command.isSign = true;
|
||||
if (command.commandExcecuteDate == null)
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบวันที่คำสั่งมีผล");
|
||||
|
||||
let profiles = command.commandRecives
|
||||
.filter((x) => x.profileId != null)
|
||||
.map(async (x) => x.profileId);
|
||||
|
||||
await new CallAPI()
|
||||
.PostData(request, "/placement/noti/profiles", {
|
||||
subject: `${command.issue}`,
|
||||
body: `${command.issue}`,
|
||||
receiverUserId: profiles,
|
||||
payload: "",//แนบไฟล์
|
||||
isSendMail: true,
|
||||
isSendInbox: true,
|
||||
receiveDate: command.commandExcecuteDate,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error calling API:", error);
|
||||
});
|
||||
if (
|
||||
new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()) <
|
||||
new Date(
|
||||
|
|
@ -1049,6 +1067,7 @@ export class CommandController extends Controller {
|
|||
commandExcecuteDate?: Date | null;
|
||||
persons: {
|
||||
refId: string;
|
||||
profileId?: string|null;
|
||||
citizenId: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue