fix: use correct basepath prefix for preview urls (#1971)

pull/1976/head
Jeffrey Schiller 2022-06-06 10:57:19 -04:00 committed by GitHub
parent b16982df0f
commit 1e7d3b25c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,11 @@ export function removePrefix(url) {
}
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 = {
...(auth && { auth: store.state.jwt }),