update order id

This commit is contained in:
unclebonn
2024-11-19 16:09:56 +07:00
parent 208ae897ef
commit 9a134645a7
2 changed files with 15 additions and 1 deletions

View File

@@ -228,6 +228,15 @@ export class OrderSchema extends PothosSchema {
paymentCode: paymentData.paymentLinkId,
},
})
// update orderId for schedule dates
await this.prisma.scheduleDate.updateMany({
where: { scheduleId: args.data.schedule.connect?.id ?? '' },
data: {
orderId: order.id,
},
})
// refetch order
return await this.prisma.order.findUnique({
where: { id: order.id },