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 },
|
data: { requestDataStatus: RequestDataStatus.Completed },
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
await tx.notification.createMany({
|
await Promise.all(
|
||||||
data: res.map((v) => ({
|
res.map((v) =>
|
||||||
title: "รายการคำขอเสร็จสิ้น / Request Complete",
|
tx.notification.create({
|
||||||
detail: "รหัส / code : " + v.code + " Completed",
|
data: {
|
||||||
receiverId: v.quotation.createdByUserId,
|
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
|
||||||
groupReceiver: { create: { name: "document_checker" } },
|
detail: "รหัส / code : " + v.code + " Completed",
|
||||||
})),
|
receiverId: v.quotation.createdByUserId,
|
||||||
});
|
groupReceiver: { create: { name: "document_checker" } },
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
await tx.quotation
|
await tx.quotation
|
||||||
.updateManyAndReturn({
|
.updateManyAndReturn({
|
||||||
|
|
@ -973,14 +977,18 @@ export class TaskActionController extends Controller {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
await tx.notification.createMany({
|
await Promise.all(
|
||||||
data: res.map((v) => ({
|
res.map((v) =>
|
||||||
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
|
tx.notification.create({
|
||||||
detail: "รหัส / code : " + v.code + " Completed",
|
data: {
|
||||||
receiverId: v.createdByUserId,
|
title: "สถานะใบเสนอราคาเปลี่ยนแปลง / Quotation Status Updated",
|
||||||
groupReceiver: { create: { name: "document_checker" } },
|
detail: "รหัส / code : " + v.code + " Completed",
|
||||||
})),
|
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