mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Fix issues with basePath.
This commit is contained in:
parent
1e8c1d0d18
commit
339cd21596
15 changed files with 66 additions and 51 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { useMemo } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getQueryString } from '../lib/url';
|
||||
import { getQueryString } from 'lib/url';
|
||||
|
||||
export default function usePageQuery() {
|
||||
const router = useRouter();
|
||||
|
|
@ -25,7 +25,9 @@ export default function usePageQuery() {
|
|||
function resolve(params) {
|
||||
const search = getQueryString({ ...query, ...params });
|
||||
|
||||
return `${pathname}${search}`;
|
||||
const { asPath } = router;
|
||||
|
||||
return `${asPath.split('?')[0]}${search}`;
|
||||
}
|
||||
|
||||
return { pathname, query, resolve, router };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue