V2 onboarding (#2543)
* fix cannot query avatarUrl * create workspace working * fix bugs related to refetch queries * onboarding working * updated dependency array * improve error handling * update types, remove as any, remove console logs * small fix
This commit is contained in:
@@ -20,21 +20,21 @@ export const ToggleField = () => {
|
||||
const handleChange = async (value: boolean) => {
|
||||
try {
|
||||
if (!updateOneObject || objectNotFoundInMetadata) {
|
||||
return;
|
||||
throw new Error('Object not found in metadata');
|
||||
}
|
||||
if (!currentWorkspaceMember?.id) {
|
||||
throw new Error('User is not logged in');
|
||||
}
|
||||
await updateOneObject({
|
||||
idToUpdate: currentWorkspaceMember?.id ?? '',
|
||||
idToUpdate: currentWorkspaceMember?.id,
|
||||
input: {
|
||||
allowImpersonation: value,
|
||||
},
|
||||
});
|
||||
setCurrentWorkspaceMember(
|
||||
(current) =>
|
||||
({
|
||||
...current,
|
||||
allowImpersonation: value,
|
||||
} as any),
|
||||
);
|
||||
setCurrentWorkspaceMember({
|
||||
...currentWorkspaceMember,
|
||||
allowImpersonation: value,
|
||||
});
|
||||
} catch (err: any) {
|
||||
enqueueSnackBar(err?.message, {
|
||||
variant: 'error',
|
||||
|
||||
Reference in New Issue
Block a user