fix: username inconsistency (#14034)

* fix: username inconsistency

* added comment

* code refactor
This commit is contained in:
Somay Chauhan
2024-03-12 15:37:53 +00:00
committed by GitHub
parent 8402dfa3a2
commit ee80577cc3
@@ -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) {