Fixed refetch query (#760)
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { getOperationName } from '@apollo/client/utilities';
|
||||||
|
|
||||||
import { EditableCellChip } from '@/ui/table/editable-cell/types/EditableChip';
|
import { EditableCellChip } from '@/ui/table/editable-cell/types/EditableChip';
|
||||||
import {
|
import {
|
||||||
@ -7,6 +8,8 @@ import {
|
|||||||
} from '~/generated/graphql';
|
} from '~/generated/graphql';
|
||||||
import { getLogoUrlFromDomainName } from '~/utils';
|
import { getLogoUrlFromDomainName } from '~/utils';
|
||||||
|
|
||||||
|
import { GET_COMPANY } from '../queries';
|
||||||
|
|
||||||
import { CompanyChip } from './CompanyChip';
|
import { CompanyChip } from './CompanyChip';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
@ -44,6 +47,7 @@ export function CompanyEditableNameChipCell({ company }: OwnProps) {
|
|||||||
id: company.id,
|
id: company.id,
|
||||||
name: internalValue,
|
name: internalValue,
|
||||||
},
|
},
|
||||||
|
refetchQueries: [getOperationName(GET_COMPANY) ?? ''],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onCancel={() => setInternalValue(company.name ?? '')}
|
onCancel={() => setInternalValue(company.name ?? '')}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { getOperationName } from '@apollo/client/utilities';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
|
|
||||||
import { EditablePeopleFullName } from '@/people/components/EditablePeopleFullName';
|
import { EditablePeopleFullName } from '@/people/components/EditablePeopleFullName';
|
||||||
@ -6,6 +7,8 @@ import { peopleNameCellFamilyState } from '@/people/states/peopleNamesFamilyStat
|
|||||||
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
|
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
|
||||||
import { useUpdatePeopleMutation } from '~/generated/graphql';
|
import { useUpdatePeopleMutation } from '~/generated/graphql';
|
||||||
|
|
||||||
|
import { GET_PERSON } from '../../queries';
|
||||||
|
|
||||||
export function EditablePeopleFullNameCell() {
|
export function EditablePeopleFullNameCell() {
|
||||||
const currentRowEntityId = useCurrentRowEntityId();
|
const currentRowEntityId = useCurrentRowEntityId();
|
||||||
|
|
||||||
@ -42,6 +45,7 @@ export function EditablePeopleFullNameCell() {
|
|||||||
firstName: internalFirstName,
|
firstName: internalFirstName,
|
||||||
lastName: internalLastName,
|
lastName: internalLastName,
|
||||||
},
|
},
|
||||||
|
refetchQueries: [getOperationName(GET_PERSON) ?? ''],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user