Fix Activities and Tasks modules (#2561)

* Fix activities

* Fix Timeline

* Refactor useCreateOne and useUpdateOne records

* Fix seeds
This commit is contained in:
Charles Bochet
2023-11-17 16:24:58 +01:00
committed by GitHub
parent a6d8cdb116
commit baf1260443
23 changed files with 259 additions and 222 deletions

View File

@ -18,6 +18,7 @@ import { useSnackBar } from '@/ui/feedback/snack-bar/hooks/useSnackBar';
import { MainButton } from '@/ui/input/button/components/MainButton';
import { TextInput } from '@/ui/input/components/TextInput';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
const StyledContentContainer = styled.div`
width: 100%;
@ -59,7 +60,7 @@ export const CreateProfile = () => {
);
const { updateOneObject, objectNotFoundInMetadata } =
useUpdateOneObjectRecord({
useUpdateOneObjectRecord<WorkspaceMember>({
objectNameSingular: 'workspaceMemberV2',
});
@ -91,7 +92,7 @@ export const CreateProfile = () => {
throw new Error('Object not found in metadata');
}
const result = await updateOneObject({
await updateOneObject({
idToUpdate: currentWorkspaceMember?.id,
input: {
firstName: data.firstName,
@ -99,10 +100,6 @@ export const CreateProfile = () => {
},
});
if (result.errors || !result.data?.updateWorkspaceMemberV2) {
throw result.errors ?? new Error('Unknown error');
}
setCurrentWorkspaceMember(
(current) =>
({