backend - getting create instance to work

This commit is contained in:
Michael Shanks 2020-03-23 12:47:31 +00:00
parent 927be23545
commit a552158af1
4 changed files with 4 additions and 2 deletions

View File

@ -164,6 +164,7 @@ const initialise = (store, initial) => async () => {
initial.actions = values(pkg.appDefinition.actions)
initial.triggers = pkg.appDefinition.triggers
initial.appInstances = pkg.application.instances
initial.appId = pkg.application.id
if (!!initial.hierarchy && !isEmpty(initial.hierarchy)) {
initial.hierarchy = constructHierarchy(initial.hierarchy)

View File

@ -118,6 +118,7 @@ export const getNewInstance = (appId, name) => {
version: { key: "" },
isNew: true,
type: "instance",
datastoreconfig: "",
id,
name,
}

View File

@ -2,7 +2,7 @@
import { getNewRecord, getNewInstance } from "../../common/core"
export async function createDatabase(appname, instanceName) {
const CREATE_DATABASE_URL = `/_builder/instance/_master/0/api/record`
const CREATE_DATABASE_URL = `/_builder/instance/_master/0/api/record/`
const database = getNewInstance(appname, instanceName);
const response = await api.post(CREATE_DATABASE_URL, database);
return await response.json()

View File

@ -9,7 +9,7 @@
let databaseName
async function createDatabase() {
const response = await api.createDatabase($store.appname, databaseName)
const response = await api.createDatabase($store.appId, databaseName)
store.createDatabaseForApp(response)
onClosed()
}