mirror of
https://github.com/twentyhq/twenty.git
synced 2025-01-02 01:04:12 +03:00
* Task update sync issue #1203 * removed unwanted state
This commit is contained in:
parent
a24e1e4dc9
commit
4f524bd2a7
@ -1,11 +1,13 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
|
||||
import { Activity, useUpdateActivityMutation } from '~/generated/graphql';
|
||||
|
||||
import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment';
|
||||
import { GET_ACTIVITIES } from '../graphql/queries/getActivities';
|
||||
|
||||
type Task = Pick<Activity, 'id'>;
|
||||
type Task = Pick<Activity, 'id' | 'completedAt'>;
|
||||
|
||||
export function useCompleteTask(task: Task) {
|
||||
const [updateActivityMutation] = useUpdateActivityMutation();
|
||||
@ -33,6 +35,7 @@ export function useCompleteTask(task: Task) {
|
||||
completedAt,
|
||||
},
|
||||
},
|
||||
refetchQueries: [getOperationName(GET_ACTIVITIES) ?? ''],
|
||||
});
|
||||
},
|
||||
[cachedTask, task.id, updateActivityMutation],
|
||||
|
Loading…
Reference in New Issue
Block a user