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

View File

@ -54,21 +54,27 @@ export const NameFields = ({
onLastNameUpdate(lastName);
}
try {
if (!currentWorkspaceMember?.id) {
throw new Error('User is not logged in');
}
if (autoSave) {
if (!updateOneObject || objectNotFoundInMetadata) {
return;
throw new Error('Object not found in metadata');
}
await updateOneObject({
idToUpdate: currentWorkspaceMember?.id ?? '',
idToUpdate: currentWorkspaceMember?.id,
input: {
firstName,
lastName,
},
});
setCurrentWorkspaceMember(
(current) => ({ ...current, firstName, lastName } as any),
);
setCurrentWorkspaceMember({
...currentWorkspaceMember,
firstName,
lastName,
});
}
} catch (error) {
logError(error);