mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 18:45:36 +01:00
Fix basePath references.
This commit is contained in:
parent
dfe157b640
commit
23d4d13c9d
5 changed files with 17 additions and 9 deletions
|
|
@ -1,14 +1,16 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { useRouter } from 'next/router';
|
||||
import { get } from 'lib/web';
|
||||
import { setShareToken } from 'redux/actions/app';
|
||||
|
||||
export default function useShareToken(shareId) {
|
||||
const { basePath } = useRouter();
|
||||
const dispatch = useDispatch();
|
||||
const shareToken = useSelector(state => state.app.shareToken);
|
||||
|
||||
async function loadToken(id) {
|
||||
const { data } = await get(`/api/share/${id}`);
|
||||
const { data } = await get(`${basePath}/api/share/${id}`);
|
||||
|
||||
if (data) {
|
||||
dispatch(setShareToken(data));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue