refactor: keep type of sortsAvailable while having type assertion
This commit is contained in:
@ -32,7 +32,7 @@ const reduceSortsToOrderBy = (sorts: Array<SortType>): OrderBy[] => {
|
|||||||
return [mappedSorts];
|
return [mappedSorts];
|
||||||
};
|
};
|
||||||
|
|
||||||
const sortsAvailable: Array<SortType<keyof GraphqlPerson>> = [
|
const sortsAvailable = [
|
||||||
{
|
{
|
||||||
id: 'created_at',
|
id: 'created_at',
|
||||||
label: 'Created at',
|
label: 'Created at',
|
||||||
@ -45,7 +45,7 @@ const sortsAvailable: Array<SortType<keyof GraphqlPerson>> = [
|
|||||||
order: 'asc',
|
order: 'asc',
|
||||||
icon: faEnvelope,
|
icon: faEnvelope,
|
||||||
},
|
},
|
||||||
];
|
] satisfies Array<SortType<keyof GraphqlPerson>>;
|
||||||
|
|
||||||
function People() {
|
function People() {
|
||||||
const [, setSorts] = useState([] as Array<SortType>);
|
const [, setSorts] = useState([] as Array<SortType>);
|
||||||
|
|||||||
Reference in New Issue
Block a user