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,
});
} catch (err) {
console.error(err);
const errorMessage = (err as { message?: string }).message;
throw new TRPCError({
code: 'BAD_REQUEST',
message:
'We were unable to update your profile. Please review the information you provided and try again.',
message: errorMessage
? errorMessage
: 'We were unable to update your profile. Please review the information you provided and try again.',
});
}
}),