Fix Activities and Tasks modules (#2561)
* Fix activities * Fix Timeline * Refactor useCreateOne and useUpdateOne records * Fix seeds
This commit is contained in:
@ -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) =>
|
||||
({
|
||||
|
||||
Reference in New Issue
Block a user