From 5a76a601d596bea86fe7ab97a37a80d7b7d86c21 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Mon, 10 Jun 2024 20:54:29 +1000 Subject: [PATCH] fix: error message --- apps/web/src/components/forms/public-profile-form.tsx | 2 +- packages/lib/server-only/user/update-public-profile.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/forms/public-profile-form.tsx b/apps/web/src/components/forms/public-profile-form.tsx index b370b866c..3607d7fe1 100644 --- a/apps/web/src/components/forms/public-profile-form.tsx +++ b/apps/web/src/components/forms/public-profile-form.tsx @@ -91,7 +91,7 @@ export const PublicProfileForm = ({ case AppErrorCode.PROFILE_URL_TAKEN: form.setError('url', { type: 'manual', - message: error.userMessage, + message: error.message, }); break; diff --git a/packages/lib/server-only/user/update-public-profile.ts b/packages/lib/server-only/user/update-public-profile.ts index 1d6b05b9f..88a3ddba5 100644 --- a/packages/lib/server-only/user/update-public-profile.ts +++ b/packages/lib/server-only/user/update-public-profile.ts @@ -57,11 +57,7 @@ export const updatePublicProfile = async ({ userId, data }: UpdatePublicProfileO }); if (isUrlTakenByAnotherUser || isUrlTakenByAnotherTeam) { - throw new AppError( - AppErrorCode.PROFILE_URL_TAKEN, - 'Profile username is taken', - 'The profile username is already taken', - ); + throw new AppError(AppErrorCode.PROFILE_URL_TAKEN, 'The profile username is already taken'); } }