refactor: keep type of sortsAvailable while having type assertion

This commit is contained in:
Sammy Teillet
2023-04-24 14:57:57 +02:00
parent c3da5fa5f4
commit 99aa39f2ba

View File

@ -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>);