update order id
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -169,6 +169,9 @@ export class UserSchema extends PothosSchema {
|
||||
throw new Error('Not allowed')
|
||||
}
|
||||
let user = ctx.http.me as UserWithChatRooms
|
||||
|
||||
console.log("hahahahahaha")
|
||||
|
||||
if (!user?.name) {
|
||||
throw new Error('User not found')
|
||||
}
|
||||
@@ -211,10 +214,12 @@ export class UserSchema extends PothosSchema {
|
||||
type: this.user(),
|
||||
args: this.builder.generator.findUniqueArgs('User'),
|
||||
resolve: async (query, _root, args) => {
|
||||
return await this.prisma.user.findUniqueOrThrow({
|
||||
const user = await this.prisma.user.findUniqueOrThrow({
|
||||
...query,
|
||||
where: args.where,
|
||||
})
|
||||
|
||||
return user;
|
||||
},
|
||||
}),
|
||||
userBySession: t.prismaField({
|
||||
|
||||
Reference in New Issue
Block a user