From e24668253fa71b787acd42636fadadfdc907b23e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 2 Oct 2020 15:49:13 +0100 Subject: [PATCH] Some quick fixes after merge. --- packages/server/src/api/controllers/model.js | 1 - packages/server/src/db/linkedRecords/linkUtils.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/model.js b/packages/server/src/api/controllers/model.js index 9a3238ed46..ca3f4023aa 100644 --- a/packages/server/src/api/controllers/model.js +++ b/packages/server/src/api/controllers/model.js @@ -81,7 +81,6 @@ exports.save = async function(ctx) { model: modelToSave, oldModel: oldModel, }) - await db.put(designDoc) ctx.eventEmitter && ctx.eventEmitter.emitModel(`model:save`, instanceId, modelToSave) diff --git a/packages/server/src/db/linkedRecords/linkUtils.js b/packages/server/src/db/linkedRecords/linkUtils.js index 2dbb4d3052..7680a2603f 100644 --- a/packages/server/src/db/linkedRecords/linkUtils.js +++ b/packages/server/src/db/linkedRecords/linkUtils.js @@ -57,12 +57,12 @@ exports.createLinkView = async instanceId => { * @returns {Promise} This will return an array of the linking documents that were found * (if any). */ -exports.getLinkDocuments = async ({ +exports.getLinkDocuments = async function({ instanceId, modelId, recordId, includeDocs, -}) => { +}) { const db = new CouchDB(instanceId) let params if (recordId != null) { @@ -84,6 +84,7 @@ exports.getLinkDocuments = async ({ // check if the view doesn't exist, it should for all new instances if (err != null && err.name === "not_found") { await exports.createLinkView(instanceId) + return exports.getLinkDocuments(arguments[0]) } else { Sentry.captureException(err) }