mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-17 06:35:54 +08:00
fix: org name is fixed (#2810)
This commit is contained in:
parent
d2cdf401b8
commit
e73432df83
@ -14,7 +14,6 @@ const signup = async (
|
|||||||
const response = await axios.post(`/register`, {
|
const response = await axios.post(`/register`, {
|
||||||
...props,
|
...props,
|
||||||
});
|
});
|
||||||
console.log(' response.data.data', response.data.data);
|
|
||||||
return {
|
return {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
error: null,
|
error: null,
|
||||||
|
@ -81,6 +81,13 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
form.setFieldValue('organizationName', responseDetails.organization);
|
form.setFieldValue('organizationName', responseDetails.organization);
|
||||||
setIsDetailsDisable(true);
|
setIsDetailsDisable(true);
|
||||||
}
|
}
|
||||||
|
}, [
|
||||||
|
getInviteDetailsResponse.data?.payload,
|
||||||
|
form,
|
||||||
|
getInviteDetailsResponse.status,
|
||||||
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
getInviteDetailsResponse.status === 'success' &&
|
getInviteDetailsResponse.status === 'success' &&
|
||||||
getInviteDetailsResponse.data?.error
|
getInviteDetailsResponse.data?.error
|
||||||
@ -91,19 +98,19 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
getInviteDetailsResponse.data?.payload,
|
getInviteDetailsResponse.data,
|
||||||
getInviteDetailsResponse.data?.error,
|
|
||||||
getInviteDetailsResponse.status,
|
getInviteDetailsResponse.status,
|
||||||
getInviteDetailsResponse,
|
|
||||||
notifications,
|
notifications,
|
||||||
form,
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const isPreferenceVisible = token === null;
|
const isPreferenceVisible = token === null;
|
||||||
|
|
||||||
const commonHandler = async (
|
const commonHandler = async (
|
||||||
values: FormValues,
|
values: FormValues,
|
||||||
callback: (e: SuccessResponse<PayloadProps>) => Promise<void> | VoidFunction,
|
callback: (
|
||||||
|
e: SuccessResponse<PayloadProps>,
|
||||||
|
values: FormValues,
|
||||||
|
) => Promise<void> | VoidFunction,
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
const { organizationName, password, firstName, email } = values;
|
const { organizationName, password, firstName, email } = values;
|
||||||
@ -129,7 +136,7 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
payload.refreshJwt,
|
payload.refreshJwt,
|
||||||
);
|
);
|
||||||
if (userResponse) {
|
if (userResponse) {
|
||||||
callback(userResponse);
|
callback(userResponse, values);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
notifications.error({
|
notifications.error({
|
||||||
@ -150,16 +157,12 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
|
|
||||||
const onAdminAfterLogin = async (
|
const onAdminAfterLogin = async (
|
||||||
userResponse: SuccessResponse<PayloadProps>,
|
userResponse: SuccessResponse<PayloadProps>,
|
||||||
|
values: FormValues,
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const {
|
|
||||||
organizationName,
|
|
||||||
isAnonymous,
|
|
||||||
hasOptedUpdates,
|
|
||||||
} = form.getFieldsValue();
|
|
||||||
const editResponse = await editOrg({
|
const editResponse = await editOrg({
|
||||||
isAnonymous,
|
isAnonymous: values.isAnonymous,
|
||||||
name: organizationName,
|
name: values.organizationName,
|
||||||
hasOptedUpdates,
|
hasOptedUpdates: values.hasOptedUpdates,
|
||||||
orgId: userResponse.payload.orgId,
|
orgId: userResponse.payload.orgId,
|
||||||
});
|
});
|
||||||
if (editResponse.statusCode === 200) {
|
if (editResponse.statusCode === 200) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user