fix admin note is required in mentor

This commit is contained in:
2024-10-29 19:49:22 +07:00
parent e003bcd634
commit 8631bd935d
5 changed files with 32 additions and 23 deletions

View File

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