update logic upload file and get centerstaff

This commit is contained in:
2024-10-17 00:52:50 +07:00
parent dddc61411f
commit 8b56334ac9
4 changed files with 162 additions and 2 deletions

View File

@@ -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