Skip to content

Commit

Permalink
refactor(front): Add type assertion on the frontend for dynamically g…
Browse files Browse the repository at this point in the history
…enerated QueryParams (SortQueryParam<CustomWidget>)
alepefe committed Sep 19, 2024
1 parent 4a0b958 commit d808095
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -37,6 +37,8 @@ import { getAuthHeader } from "@/utils/auth-header";
import { selectedRowAtom } from "../../store";

import useColumns from "./columns";
import { SortQueryParam } from "@shared/schemas/query-param.schema";
import { CustomWidget } from "@shared/dto/widgets/custom-widget.entity";

const ROWS_PER_PAGE_OPTIONS = ["10", "25", "50", "100"];

@@ -73,7 +75,9 @@ const SavedVisualizationsTable: FC = () => {
"updatedAt",
],
sort: Object.keys(sorting).length
? sorting.map((sort) => `${sort.desc ? "" : "-"}${sort.id}`)
? (sorting.map(
(sort) => `${sort.desc ? "" : "-"}${sort.id}`,
) as SortQueryParam<CustomWidget>)
: ["-updatedAt"],
pageSize: pagination.size,
pageNumber: pagination.page,

0 comments on commit d808095

Please sign in to comment.