add context subscription

This commit is contained in:
2024-10-29 02:21:18 +07:00
parent ba54d3466c
commit 9423a36eeb
7 changed files with 58 additions and 19 deletions

View File

@@ -243,6 +243,9 @@ export class ServiceSchema extends PothosSchema {
}),
},
resolve: async (query, root, args, ctx, info) => {
if (ctx.isSubscription) {
throw new Error('Not allowed');
}
return await this.prisma.$transaction(async (prisma) => {
// check if service is already approved or rejected
const service = await prisma.service.findUnique({
@@ -265,7 +268,7 @@ export class ServiceSchema extends PothosSchema {
adminNote: {
create: {
content: args.adminNote ?? '',
notedByUserId: ctx.me.id,
notedByUserId: ctx.http.me.id,
},
},
},