when linking email store as lowercase

This commit is contained in:
keyan 2022-09-12 14:10:15 -05:00
parent b7132cc962
commit 48990d5987
1 changed files with 4 additions and 1 deletions

View File

@ -245,7 +245,10 @@ export default {
}
try {
await models.user.update({ where: { id: me.id }, data: { email } })
await models.user.update({
where: { id: me.id },
data: { email: email.toLowerCase() }
})
} catch (error) {
if (error.code === 'P2002') {
throw new UserInputError('email taken')