Fixed bug for refectch activities and create activity on the currently filtered user. (#1493)

* Fixed bug for refectch activities and create activity on the currently filtered user.

* Refactor optimistif effect

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2023-09-11 08:02:51 +02:00
committed by GitHub
parent 08727aafe5
commit 9be069bedc
37 changed files with 363 additions and 243 deletions

View File

@ -1,4 +1,5 @@
import { useApolloClient } from '@apollo/client';
import { getOperationName } from '@apollo/client/utilities';
import { useFilteredSearchEntityQuery } from '@/search/hooks/useFilteredSearchEntityQuery';
import { SingleEntitySelect } from '@/ui/input/relation-picker/components/SingleEntitySelect';
@ -14,6 +15,7 @@ import {
} from '~/generated/graphql';
import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment';
import { GET_ACTIVITIES } from '../graphql/queries/getActivities';
export type OwnProps = {
activity: Pick<Activity, 'id'> & {
@ -86,6 +88,7 @@ export function ActivityAssigneePicker({
},
},
},
refetchQueries: [getOperationName(GET_ACTIVITIES) ?? ''],
});
}

View File

@ -119,6 +119,7 @@ export function ActivityEditor({
title: newTitle,
},
},
refetchQueries: [getOperationName(GET_ACTIVITIES) ?? ''],
});
},
[activity.id, cachedActivity, updateActivityMutation],