Feat/sidecar components (#1578)

* Added a new eslint plugin in TypeScript for Effect components

* Fixed edge cases

* Fixed lint

* Fix eslint

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2023-09-15 02:04:45 +02:00
committed by GitHub
parent 09db29c91a
commit 84a27b148f
35 changed files with 4201 additions and 49 deletions

View File

@ -0,0 +1,32 @@
import {
PersonOrderByWithRelationInput,
SortOrder,
useGetPeopleQuery,
} from '~/generated/graphql';
import { useSetPeopleEntityTable } from '../hooks/useSetPeopleEntityTable';
export function 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 <></>;
}