bugfix: data components hitting correct url again

This commit is contained in:
Michael Shanks 2020-06-03 22:12:09 +01:00
parent 45f4ab1568
commit 3471afe587
3 changed files with 12 additions and 5 deletions

View File

@ -23,7 +23,7 @@ export const bbFactory = ({
}
const apiCall = method => (url, body) =>
fetch(relativeUrl(url), {
fetch(url, {
method: method,
headers: {
"Content-Type": "application/json",

View File

@ -45,7 +45,7 @@ const copyClientLib = async (appPath, pageName) => {
const buildIndexHtml = async (config, appId, pageName, appPath, pkg) => {
const appPublicPath = publicPath(appPath, pageName)
const appRootPath = appId
const appRootPath = rootPath(config, appId)
const stylesheetUrl = s =>
s.startsWith("http") ? s : `/${rootPath(config, appId)}/${s}`

View File

@ -25,9 +25,16 @@
const login = async () => {
loading = true
const response = await _bb.api.post("/api/authenticate", {
username,
password,
const response = await fetch(_bb.relativeUrl("/api/authenticate"), {
body: JSON.stringify({
username,
password,
}),
headers: {
"Content-Type": "application/json",
"x-user-agent": "Budibase Builder",
},
method: "POST",
})
if (response.status === 200) {