diff --git a/packages/builder/src/builderStore/storeUtils.js b/packages/builder/src/builderStore/storeUtils.js index aeff3f2528..9111f06bd5 100644 --- a/packages/builder/src/builderStore/storeUtils.js +++ b/packages/builder/src/builderStore/storeUtils.js @@ -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, diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index c936f39c0b..a8c22f0683 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -41,7 +41,6 @@ .map(template => template.create()) for (let screen of screens) { - console.log(JSON.stringify(screen)) try { await store.createScreen(screen) } catch (_) { diff --git a/packages/server/src/db/utils.js b/packages/server/src/db/utils.js index 951fa3d0d3..7577a3b638 100644 --- a/packages/server/src/db/utils.js +++ b/packages/server/src/db/utils.js @@ -122,7 +122,14 @@ exports.generateAutomationID = () => { * @returns {string} The new link doc ID which the automation doc can be stored under. */ exports.generateLinkID = (tableId1, tableId2, rowId1, rowId2) => { - return `${DocumentTypes.AUTOMATION}${SEPARATOR}${tableId1}${SEPARATOR}${tableId2}${SEPARATOR}${rowId1}${SEPARATOR}${rowId2}` + return `${DocumentTypes.LINK}${SEPARATOR}${tableId1}${SEPARATOR}${tableId2}${SEPARATOR}${rowId1}${SEPARATOR}${rowId2}` +} + +/** + * Gets parameters for retrieving link docs, this is a utility function for the getDocParams function. + */ +exports.getLinkParams = (otherProps = {}) => { + return getDocParams(DocumentTypes.LINK, null, otherProps) } /**