fix: Correctly prefill username in case of non-org email invite in an org (#12854)

* fix: Correctly prefill username in case of non-org email invite in an org

* Update test

---------

Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
Hariom BalharaandUdit Takkar authored and GitHub committed 2023-12-19 02:44:48 +00:00
1 parent f77e480d02
commit 4b16860d07
6 files changed
+73 -15

No files matched your search

+2 -1
View File
@@ -5,12 +5,13 @@ type ResponseUsernameApi = {
suggestion?: string;
};
export async function fetchUsername(username: string) {
export async function fetchUsername(username: string, orgSlug: string | null) {
const response = await fetch("/api/username", {
credentials: "include",
method: "POST",
body: JSON.stringify({
username: username.trim(),
orgSlug: orgSlug ?? undefined,
}),
headers: {
"Content-Type": "application/json",