Fixed refetch query for GetCommentThreadsByTargets (#336)
* Fixed refetch query for GetCommentThreadsByTargets * Improvement : use apollo util getOperationName to de-hard code refetch queries arrays
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { GET_COMPANIES } from '@/companies/services';
|
||||
import { EntityTableActionBarButton } from '@/ui/components/table/action-bar/EntityTableActionBarButton';
|
||||
import { IconTrash } from '@/ui/icons/index';
|
||||
import { useResetTableRowSelection } from '@/ui/tables/hooks/useResetTableRowSelection';
|
||||
@ -12,7 +14,7 @@ export function TableActionBarButtonDeleteCompanies() {
|
||||
const resetRowSelection = useResetTableRowSelection();
|
||||
|
||||
const [deleteCompanies] = useDeleteCompaniesMutation({
|
||||
refetchQueries: ['GetCompanies'],
|
||||
refetchQueries: [getOperationName(GET_COMPANIES) ?? ''],
|
||||
});
|
||||
|
||||
async function handleDeleteClick() {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { GET_PEOPLE } from '@/people/services';
|
||||
import { EntityTableActionBarButton } from '@/ui/components/table/action-bar/EntityTableActionBarButton';
|
||||
import { IconTrash } from '@/ui/icons/index';
|
||||
import { useResetTableRowSelection } from '@/ui/tables/hooks/useResetTableRowSelection';
|
||||
@ -12,7 +14,7 @@ export function TableActionBarButtonDeletePeople() {
|
||||
const resetRowSelection = useResetTableRowSelection();
|
||||
|
||||
const [deletePeople] = useDeletePeopleMutation({
|
||||
refetchQueries: ['GetPeople'],
|
||||
refetchQueries: [getOperationName(GET_PEOPLE) ?? ''],
|
||||
});
|
||||
|
||||
async function handleDeleteClick() {
|
||||
|
||||
Reference in New Issue
Block a user