2282 Rename components to use the new naming convention part 1 (#2293)
renaming in progress
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
import {
|
||||
PersonOrderByWithRelationInput,
|
||||
SortOrder,
|
||||
useGetPeopleQuery,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
import { useSetPeopleRecordTable } from '../hooks/useSetPeopleRecordTable';
|
||||
|
||||
export const PeopleRecordTableDataEffect = ({
|
||||
orderBy = [
|
||||
{
|
||||
createdAt: SortOrder.Desc,
|
||||
},
|
||||
],
|
||||
whereFilters,
|
||||
}: {
|
||||
orderBy?: PersonOrderByWithRelationInput[];
|
||||
whereFilters?: any;
|
||||
}) => {
|
||||
const setPeopleRecordTable = useSetPeopleRecordTable();
|
||||
|
||||
useGetPeopleQuery({
|
||||
variables: { orderBy, where: whereFilters },
|
||||
onCompleted: (data) => {
|
||||
const people = data.people ?? [];
|
||||
|
||||
setPeopleRecordTable(people);
|
||||
},
|
||||
});
|
||||
|
||||
return <></>;
|
||||
};
|
||||
Reference in New Issue
Block a user