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:
bosiraphael
2023-11-16 17:09:10 +01:00
committed by GitHub
parent b1b6bbe7d3
commit 0ae9373532
18 changed files with 127 additions and 120 deletions
@@ -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',