Files
twenty/front/src/modules/people/components/PeopleEntityTableDataEffect.tsx
Lucas Bordeau 3c4ab605db Fix eslint-plugin-twenty (#1640)
* Fixed color rule

* Fixed naming

* Fix effect component rule

* Deactivated broken rules

* Fixed lint

* Complete eslint-plugin-twenty work

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-09-18 16:38:57 -07:00

33 lines
662 B
TypeScript

import {
PersonOrderByWithRelationInput,
SortOrder,
useGetPeopleQuery,
} from '~/generated/graphql';
import { useSetPeopleEntityTable } from '../hooks/useSetPeopleEntityTable';
export const PeopleEntityTableDataEffect = ({
orderBy = [
{
createdAt: SortOrder.Desc,
},
],
whereFilters,
}: {
orderBy?: PersonOrderByWithRelationInput[];
whereFilters?: any;
}) => {
const setPeopleEntityTable = useSetPeopleEntityTable();
useGetPeopleQuery({
variables: { orderBy, where: whereFilters },
onCompleted: (data) => {
const people = data.people ?? [];
setPeopleEntityTable(people);
},
});
return <></>;
};