fix: error create many with relation
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
c34af75bad
commit
c7183887c9
1 changed files with 24 additions and 16 deletions
|
|
@ -925,14 +925,18 @@ export class TaskActionController extends Controller {
|
|||
data: { requestDataStatus: RequestDataStatus.Completed },
|
||||
})
|
||||
.then(async (res) => {
|
||||
await tx.notification.createMany({
|
||||
data: res.map((v) => ({
|
||||
title: "รายการคำขอเสร็จสิ้น / Request Complete",
|
||||
detail: "รหัส / code : " + v.code + " Completed",
|
||||
receiverId: v.quotation.createdByUserId,
|
||||
groupReceiver: { create: { name: "document_checker" } },
|
||||
})),
|
||||
});
|
||||
await Promise.all(
|
||||
res.map((v) =>
|
||||
tx.notification.create({
|
||||
data: {
|
||||
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
|
||||
detail: "รหัส / code : " + v.code + " Completed",
|
||||
receiverId: v.quotation.createdByUserId,
|
||||
groupReceiver: { create: { name: "document_checker" } },
|
||||
},
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
await tx.quotation
|
||||
.updateManyAndReturn({
|
||||
|
|
@ -973,14 +977,18 @@ export class TaskActionController extends Controller {
|
|||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
await tx.notification.createMany({
|
||||
data: res.map((v) => ({
|
||||
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
|
||||
detail: "รหัส / code : " + v.code + " Completed",
|
||||
receiverId: v.createdByUserId,
|
||||
groupReceiver: { create: { name: "document_checker" } },
|
||||
})),
|
||||
});
|
||||
await Promise.all(
|
||||
res.map((v) =>
|
||||
tx.notification.create({
|
||||
data: {
|
||||
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
|
||||
detail: "รหัส / code : " + v.code + " Completed",
|
||||
receiverId: v.createdByUserId,
|
||||
groupReceiver: { create: { name: "document_checker" } },
|
||||
},
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const token = await this.#getLineToken();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue