day len server theo loi Khoi noi, toi xin tuyen bo mien tru trach nhiem

This commit is contained in:
2024-11-05 15:02:53 +07:00
parent 0f68b51d75
commit 56ba2808c8
22 changed files with 482 additions and 63 deletions

View File

@@ -142,7 +142,7 @@ export class CenterMentorSchema extends PothosSchema {
throw new Error('Not allowed')
}
// get centerId by user id from context
const userId = ctx.http.me.id
const userId = ctx.http.me?.id
if (!userId) {
throw new Error('User ID is required')
}
@@ -266,7 +266,7 @@ export class CenterMentorSchema extends PothosSchema {
data: {
content: args.adminNote ?? '',
mentorId: mentor.id,
notedByUserId: ctx.http.me.id,
notedByUserId: ctx.http.me?.id ?? '',
},
})
// update user role
@@ -312,7 +312,7 @@ export class CenterMentorSchema extends PothosSchema {
adminNote: {
create: {
content: args.adminNote ?? '',
notedByUserId: ctx.http.me.id,
notedByUserId: ctx.http.me?.id ?? '',
updatedAt: new Date(),
},
},