feat: notify document_checker when task is canceled
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s

This commit is contained in:
Methapon2001 2025-07-25 09:42:22 +07:00
parent a30bc33b81
commit 9e208dee89

View file

@ -464,14 +464,29 @@ export class RequestDataActionController extends Controller {
})), })),
}); });
}), }),
tx.taskOrder.updateMany({ tx.taskOrder
where: { .updateManyAndReturn({
taskList: { where: {
every: { taskStatus: TaskStatus.Canceled }, taskList: {
every: { taskStatus: TaskStatus.Canceled },
},
}, },
}, data: { taskOrderStatus: TaskStatus.Canceled },
data: { taskOrderStatus: TaskStatus.Canceled }, })
}), .then(async (res) => {
await Promise.all(
res.map((v) =>
tx.notification.create({
data: {
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
detail: "รหัส / code : " + v.code + " Canceled",
receiverId: v.createdByUserId,
groupReceiver: { create: { name: "document_checker" } },
},
}),
),
);
}),
]); ]);
const token = await this.#getLineToken(); const token = await this.#getLineToken();