Skip to content

Commit

Permalink
fix: username inconsistency (calcom#14034)
Browse files Browse the repository at this point in the history
* fix: username inconsistency

* added comment

* code refactor
  • Loading branch information
SomayChauhan authored Mar 12, 2024
1 parent 8402dfa commit ee80577
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
throw new TRPCError({ code: "BAD_REQUEST", message: t("username_already_taken") });
}
}
} else if (input.username && user.organizationId && user.movedToProfileId) {
// don't change user.username if we have profile.username
delete data.username;
}

if (isPremiumUsername) {
Expand Down

0 comments on commit ee80577

Please sign in to comment.