update logic upload file and get centerstaff
This commit is contained in:
@@ -67,6 +67,24 @@ export class CenterSchema extends PothosSchema {
|
||||
});
|
||||
},
|
||||
}),
|
||||
// get current center of centerstaff by providing userId
|
||||
centerByCenterStaff: t.prismaField({
|
||||
type: this.center(),
|
||||
args: {
|
||||
userId: t.arg({ type: 'String', required: true }),
|
||||
},
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.center.findFirst({
|
||||
where: {
|
||||
CenterStaff: {
|
||||
some: {
|
||||
staffId: args.userId,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
// mutation section
|
||||
|
||||
Reference in New Issue
Block a user