feat: notify document_checker when task is canceled
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
This commit is contained in:
parent
a30bc33b81
commit
9e208dee89
1 changed files with 22 additions and 7 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue