* 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>
33 lines
662 B
TypeScript
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 <></>;
|
|
};
|