Merge pull request #1 from EPESS/update_orderid_into_schedule_dates

Update orderid into schedule dates
This commit is contained in:
unclebonn
2024-11-19 16:16:06 +07:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -228,6 +228,15 @@ export class OrderSchema extends PothosSchema {
paymentCode: paymentData.paymentLinkId, 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 // refetch order
return await this.prisma.order.findUnique({ return await this.prisma.order.findUnique({
where: { id: order.id }, where: { id: order.id },

View File

@@ -169,6 +169,7 @@ export class UserSchema extends PothosSchema {
throw new Error('Not allowed') throw new Error('Not allowed')
} }
let user = ctx.http.me as UserWithChatRooms let user = ctx.http.me as UserWithChatRooms
if (!user?.name) { if (!user?.name) {
throw new Error('User not found') throw new Error('User not found')
} }