1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00

Fixes the link doc ID so that they do not start with automation ID and fixes an error that was occurring when creating tables.

This commit is contained in:
mike12345567 2020-10-12 14:31:17 +01:00
parent 2ca3bf1be9
commit 9841aab689
3 changed files with 10 additions and 3 deletions

View file

@ -36,7 +36,8 @@ export const saveCurrentPreviewItem = s =>
: saveScreenApi(s.currentPreviewItem, s)
export const savePage = async s => {
const page = s.pages[s.currentPageName]
const pageName = s.currentPageName || "main"
const page = s.pages[pageName]
await api.post(`/_builder/api/${s.appId}/pages/${s.currentPageName}`, {
page: { componentLibraries: s.pages.componentLibraries, ...page },
uiFunctions: s.currentPageFunctions,

View file

@ -41,7 +41,6 @@
.map(template => template.create())
for (let screen of screens) {
console.log(JSON.stringify(screen))
try {
await store.createScreen(screen)
} catch (_) {

View file

@ -124,7 +124,14 @@ exports.generateAutomationID = () => {
* @returns {string} The new link doc ID which the automation doc can be stored under.
*/
exports.generateLinkID = (modelId1, modelId2, recordId1, recordId2) => {
return `${DocumentTypes.AUTOMATION}${SEPARATOR}${modelId1}${SEPARATOR}${modelId2}${SEPARATOR}${recordId1}${SEPARATOR}${recordId2}`
return `${DocumentTypes.LINK}${SEPARATOR}${modelId1}${SEPARATOR}${modelId2}${SEPARATOR}${recordId1}${SEPARATOR}${recordId2}`
}
/**
* Gets parameters for retrieving link docs, this is a utility function for the getDocParams function.
*/
exports.getLinkParams = (otherProps = {}) => {
return getDocParams(DocumentTypes.LINK, null, otherProps)
}
/**