Refactor filter handling for queries.
This commit is contained in:
1 parent
5b300f1ff5
commit
ee6c68d27c
107 files changed
+731
-835
No files matched your search
@@ -9,11 +9,11 @@ export function useNavigation() {
|
||||
const [, websiteId] = pathname.match(/\/websites\/([a-f0-9-]+)/) || [];
|
||||
const query = Object.fromEntries(searchParams);
|
||||
|
||||
const updateParams = (params?: { [key: string]: string | number }) => {
|
||||
const updateParams = (params?: Record<string, string | number>) => {
|
||||
return !params ? pathname : buildUrl(pathname, { ...query, ...params });
|
||||
};
|
||||
|
||||
const renderUrl = (path: string, params?: { [key: string]: string | number } | false) => {
|
||||
const renderUrl = (path: string, params?: Record<string, string | number> | false) => {
|
||||
return buildUrl(
|
||||
teamId ? `/teams/${teamId}${path}` : path,
|
||||
params === false ? {} : { ...query, ...params },
|
||||
|
||||
Reference in new issue
Block a user