Created new hook to handle visits filtering via query string

This commit is contained in:
Alejandro Celaya
2022-12-03 12:15:36 +01:00
parent 165afa436d
commit d2ebc880a0
9 changed files with 96 additions and 24 deletions

View File

@@ -36,7 +36,6 @@ export const useShortUrlsQuery = (): [ShortUrlsFiltering, ToFirstPage] => {
({ orderBy, tags, ...rest }: ShortUrlsQuery): ShortUrlsFiltering => {
const parsedOrderBy = orderBy ? stringToOrder<ShortUrlsOrderableFields>(orderBy) : undefined;
const parsedTags = tags?.split(',') ?? [];
return { ...rest, orderBy: parsedOrderBy, tags: parsedTags };
},
),