fix: email update bug (#10306)

Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
Udit TakkarandKeith Williams authored and GitHub committed 2023-07-27 10:41:33 +02:00
1 parent cdb78b686b
commit 4f488be654
5 files changed
+24 -4

No files matched your search

@@ -98,6 +98,11 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
});
}
}
const hasEmailBeenChanged = userToUpdate.email !== data.email;
if (hasEmailBeenChanged) {
data.emailVerified = null;
}
const updatedUser = await prisma.user.update({
where: {