fix(serve): using paths without base url
This commit is contained in:
parent
a07fbfd7b7
commit
23d6d41148
3 changed files with 13 additions and 12 deletions
|
|
@ -21,10 +21,10 @@ function throttledDebounce(callback, maxDebounceTimes, debounceDelay) {
|
|||
};
|
||||
|
||||
|
||||
async function fetchPageContent(pageSlug) {
|
||||
async function fetchPageContent(pageData) {
|
||||
// TODO: handle non 200 status codes/time outs
|
||||
// TODO: add retries
|
||||
const response = await fetch(`/api/pages/${pageSlug}/content/`);
|
||||
const response = await fetch(`${pageData.baseUrl}/api/pages/${pageData.slug}/content/`);
|
||||
const content = await response.text();
|
||||
|
||||
return content;
|
||||
|
|
@ -336,7 +336,7 @@ function setupCollapsibleGrids() {
|
|||
async function setupPage() {
|
||||
const pageElement = document.getElementById("page");
|
||||
const pageContentElement = document.getElementById("page-content");
|
||||
const pageContent = await fetchPageContent(pageData.slug);
|
||||
const pageContent = await fetchPageContent(pageData);
|
||||
|
||||
pageContentElement.innerHTML = pageContent;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue