feat: avoid updating password with existing password

This commit is contained in:
Ephraim Atta-Duncan
2023-08-30 03:26:24 +00:00
committed by Mythie
parent 9524875e98
commit cd1b4796fc

View File

@ -40,12 +40,13 @@ export const profileRouter = router({
password, password,
}); });
} catch (err) { } catch (err) {
console.error(err); const errorMessage = (err as { message?: string }).message;
throw new TRPCError({ throw new TRPCError({
code: 'BAD_REQUEST', code: 'BAD_REQUEST',
message: message: errorMessage
'We were unable to update your profile. Please review the information you provided and try again.', ? errorMessage
: 'We were unable to update your profile. Please review the information you provided and try again.',
}); });
} }
}), }),