feat: implement AI suggestion
This commit is contained in:
@@ -193,28 +193,6 @@ export class CenterMentorSchema extends PothosSchema {
|
||||
})
|
||||
},
|
||||
}),
|
||||
testInviteCenterMentor: t.prismaField({
|
||||
type: this.centerMentor(),
|
||||
args: {
|
||||
email: t.arg({ type: 'String', required: true }),
|
||||
centerId: t.arg({ type: 'String', required: true }),
|
||||
},
|
||||
description: 'Test invite center mentor.',
|
||||
resolve: async (_query, _root, args) => {
|
||||
return this.prisma.$transaction(async () => {
|
||||
// sign token
|
||||
const token = this.jwtUtils.signTokenRS256({ centerId: args.centerId, email: args.email }, '1d')
|
||||
// build invite url
|
||||
const inviteUrl = `${process.env.CENTER_BASE_URL}/invite?token=${token}`
|
||||
// mail to user with params centerId, email
|
||||
await this.mailService.sendTemplateEmail([args.email], 'Invite to center', 'MentorInvitation', {
|
||||
center_name: args.centerId,
|
||||
invite_url: inviteUrl,
|
||||
})
|
||||
return null
|
||||
})
|
||||
},
|
||||
}),
|
||||
approveOrRejectCenterMentor: t.prismaField({
|
||||
type: this.centerMentor(),
|
||||
description: 'Approve or reject a center mentor.',
|
||||
|
||||
Reference in New Issue
Block a user