Skip to content

Commit

Permalink
fix: use correct basepath prefix for preview urls (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
jisqyv committed Jun 6, 2022
1 parent b16982d commit 1e7d3b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/api/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down

0 comments on commit 1e7d3b2

Please sign in to comment.