fix: use correct basepath prefix for preview urls (#1971)
This commit is contained in:
parent
b16982df0f
commit
1e7d3b25c2
|
@ -62,7 +62,11 @@ export function removePrefix(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createURL(endpoint, params = {}, auth = true) {
|
export function createURL(endpoint, params = {}, auth = true) {
|
||||||
const url = new URL(encodePath(endpoint), origin + baseURL);
|
let prefix = baseURL;
|
||||||
|
if (prefix[prefix.length] !== "/") {
|
||||||
|
prefix = prefix + "/";
|
||||||
|
}
|
||||||
|
const url = new URL(prefix + encodePath(endpoint), origin);
|
||||||
|
|
||||||
const searchParams = {
|
const searchParams = {
|
||||||
...(auth && { auth: store.state.jwt }),
|
...(auth && { auth: store.state.jwt }),
|
||||||
|
|
Loading…
Reference in New Issue