backend - getting create instance to work
This commit is contained in:
parent
e073d30e44
commit
c6beee73e5
|
@ -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)
|
||||
|
|
|
@ -118,6 +118,7 @@ export const getNewInstance = (appId, name) => {
|
|||
version: { key: "" },
|
||||
isNew: true,
|
||||
type: "instance",
|
||||
datastoreconfig: "",
|
||||
id,
|
||||
name,
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue