prettier auto fix
This commit is contained in:
parent
c2f98076fd
commit
86834a9046
|
@ -1,17 +1,17 @@
|
||||||
import api from "../../builderStore/api";
|
import api from "../../builderStore/api"
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteRecord(record, { appname, instanceId }) {
|
export async function deleteRecord(record, { appname, instanceId }) {
|
||||||
const DELETE_RECORDS_URL = `/_builder/instance/${appname}/${instanceId}/api/record${record.key}`
|
const DELETE_RECORDS_URL = `/_builder/instance/${appname}/${instanceId}/api/record${record.key}`
|
||||||
const response = await api.delete(DELETE_RECORDS_URL);
|
const response = await api.delete(DELETE_RECORDS_URL)
|
||||||
return response;
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveRecord(record, { appname, instanceId }) {
|
export async function saveRecord(record, { appname, instanceId }) {
|
||||||
|
@ -30,11 +30,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchDataForView(viewName, { appname, instanceId }) {
|
export async function fetchDataForView(viewName, { appname, instanceId }) {
|
||||||
const FETCH_RECORDS_URL = `/_builder/instance/${appname}/${instanceId}/api/listRecords/${viewName}`;
|
const FETCH_RECORDS_URL = `/_builder/instance/${appname}/${instanceId}/api/listRecords/${viewName}`
|
||||||
|
|
||||||
const response = await api.get(FETCH_RECORDS_URL);
|
|
||||||
return await response.json();
|
|
||||||
|
|
||||||
|
const response = await api.get(FETCH_RECORDS_URL)
|
||||||
|
return await response.json()
|
||||||
}
|
}
|
||||||
|
|
||||||
function overwritePresentProperties(baseObj, overwrites) {
|
function overwritePresentProperties(baseObj, overwrites) {
|
||||||
|
@ -43,5 +42,5 @@
|
||||||
for (let key in base) {
|
for (let key in base) {
|
||||||
if (overwrites[key]) base[key] = overwrites[key]
|
if (overwrites[key]) base[key] = overwrites[key]
|
||||||
}
|
}
|
||||||
return base;
|
return base
|
||||||
}
|
}
|
Loading…
Reference in New Issue