fix admin note is required in mentor
This commit is contained in:
@@ -163,7 +163,7 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
// mail to user with params centerId, email
|
||||
await this.mailService.sendTemplateEmail(
|
||||
[args.email],
|
||||
'Invite to center',
|
||||
`Thư mời làm việc tại trung tâm ${center.name}`,
|
||||
'MentorInvitation',
|
||||
{
|
||||
center_name: center.name,
|
||||
@@ -220,10 +220,6 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
throw new Error('Not allowed')
|
||||
}
|
||||
return this.prisma.$transaction(async (prisma) => {
|
||||
// validate input
|
||||
if (args.approved && !args.adminNote) {
|
||||
throw new Error('Admin note is required')
|
||||
}
|
||||
// get mentor info
|
||||
const mentor = await prisma.user.findUnique({
|
||||
where: args.where,
|
||||
|
||||
Reference in New Issue
Block a user