backend - getting create instance to work
This commit is contained in:
parent
927be23545
commit
a552158af1
|
@ -164,6 +164,7 @@ const initialise = (store, initial) => async () => {
|
||||||
initial.actions = values(pkg.appDefinition.actions)
|
initial.actions = values(pkg.appDefinition.actions)
|
||||||
initial.triggers = pkg.appDefinition.triggers
|
initial.triggers = pkg.appDefinition.triggers
|
||||||
initial.appInstances = pkg.application.instances
|
initial.appInstances = pkg.application.instances
|
||||||
|
initial.appId = pkg.application.id
|
||||||
|
|
||||||
if (!!initial.hierarchy && !isEmpty(initial.hierarchy)) {
|
if (!!initial.hierarchy && !isEmpty(initial.hierarchy)) {
|
||||||
initial.hierarchy = constructHierarchy(initial.hierarchy)
|
initial.hierarchy = constructHierarchy(initial.hierarchy)
|
||||||
|
|
|
@ -118,6 +118,7 @@ export const getNewInstance = (appId, name) => {
|
||||||
version: { key: "" },
|
version: { key: "" },
|
||||||
isNew: true,
|
isNew: true,
|
||||||
type: "instance",
|
type: "instance",
|
||||||
|
datastoreconfig: "",
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { getNewRecord, getNewInstance } from "../../common/core"
|
import { getNewRecord, getNewInstance } from "../../common/core"
|
||||||
|
|
||||||
export async function createDatabase(appname, instanceName) {
|
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 database = getNewInstance(appname, instanceName);
|
||||||
const response = await api.post(CREATE_DATABASE_URL, database);
|
const response = await api.post(CREATE_DATABASE_URL, database);
|
||||||
return await response.json()
|
return await response.json()
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
let databaseName
|
let databaseName
|
||||||
|
|
||||||
async function createDatabase() {
|
async function createDatabase() {
|
||||||
const response = await api.createDatabase($store.appname, databaseName)
|
const response = await api.createDatabase($store.appId, databaseName)
|
||||||
store.createDatabaseForApp(response)
|
store.createDatabaseForApp(response)
|
||||||
onClosed()
|
onClosed()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue