refactor schema to match database schema

This commit is contained in:
2024-10-27 13:12:24 +07:00
parent 8d46676a37
commit 9e0e97a560
14 changed files with 73 additions and 63 deletions

View File

@@ -67,10 +67,10 @@ export class CenterSchema extends PothosSchema {
chatRoom: t.relation('chatRoom', {
description: 'The chat room associated with the center.',
}),
centerStaff: t.relation('CenterStaff', {
centerStaff: t.relation('centerStaff', {
description: 'The staff members of the center.',
}),
resume: t.relation('Resume', {
resume: t.relation('resume', {
description: 'The resume of the center.',
}),
centerStatus: t.expose('centerStatus', {
@@ -123,7 +123,7 @@ export class CenterSchema extends PothosSchema {
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.center.findFirst({
where: {
CenterStaff: {
centerStaff: {
some: {
staffId: args.userId,
},