1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

Some quick fixes after merge.

This commit is contained in:
mike12345567 2020-10-02 15:49:13 +01:00
parent 6b222ffbf0
commit e24668253f
2 changed files with 3 additions and 3 deletions

View file

@ -81,7 +81,6 @@ exports.save = async function(ctx) {
model: modelToSave, model: modelToSave,
oldModel: oldModel, oldModel: oldModel,
}) })
await db.put(designDoc)
ctx.eventEmitter && ctx.eventEmitter &&
ctx.eventEmitter.emitModel(`model:save`, instanceId, modelToSave) ctx.eventEmitter.emitModel(`model:save`, instanceId, modelToSave)

View file

@ -57,12 +57,12 @@ exports.createLinkView = async instanceId => {
* @returns {Promise<object[]>} This will return an array of the linking documents that were found * @returns {Promise<object[]>} This will return an array of the linking documents that were found
* (if any). * (if any).
*/ */
exports.getLinkDocuments = async ({ exports.getLinkDocuments = async function({
instanceId, instanceId,
modelId, modelId,
recordId, recordId,
includeDocs, includeDocs,
}) => { }) {
const db = new CouchDB(instanceId) const db = new CouchDB(instanceId)
let params let params
if (recordId != null) { if (recordId != null) {
@ -84,6 +84,7 @@ exports.getLinkDocuments = async ({
// check if the view doesn't exist, it should for all new instances // check if the view doesn't exist, it should for all new instances
if (err != null && err.name === "not_found") { if (err != null && err.name === "not_found") {
await exports.createLinkView(instanceId) await exports.createLinkView(instanceId)
return exports.getLinkDocuments(arguments[0])
} else { } else {
Sentry.captureException(err) Sentry.captureException(err)
} }