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:
1 parent
f77e480d02
commit
4b16860d07
6 files changed
+73
-15
No files matched your search
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user