update payment
This commit is contained in:
@@ -72,6 +72,20 @@ export class ScheduleSchema extends PothosSchema {
|
||||
})
|
||||
}
|
||||
|
||||
@PothosRef()
|
||||
scheduleConnection() {
|
||||
return this.builder.simpleObject('ScheduleConnection', {
|
||||
fields: (t) => ({
|
||||
totalCount: t.int({
|
||||
nullable: true,
|
||||
}),
|
||||
schedules: t.field({
|
||||
type: [this.schedule()],
|
||||
}),
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
@PothosRef()
|
||||
scheduleSlot() {
|
||||
return this.builder.simpleObject('ScheduleSlot', {
|
||||
@@ -326,6 +340,28 @@ d72a864e-2f41-45ab-9c9b-bf0512a31883,e9be51fd-2382-4e43-9988-74e76fde4b56,2024-1
|
||||
})
|
||||
},
|
||||
}),
|
||||
|
||||
updateScheduleStatus: t.prismaField({
|
||||
type: this.schedule(),
|
||||
description: 'Update a schedule status.',
|
||||
args: {
|
||||
scheduleId: t.arg({
|
||||
type: 'String',
|
||||
required: true,
|
||||
}),
|
||||
status: t.arg({
|
||||
type: ScheduleStatus,
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.schedule.update({
|
||||
...query,
|
||||
where: { id: args.scheduleId },
|
||||
data: { status: args.status },
|
||||
})
|
||||
},
|
||||
}),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user