1
0
Fork 0
mirror of synced 2024-07-02 13:01:09 +12:00

fix table view export in prod

This commit is contained in:
Martin McKeaveney 2021-10-07 11:26:09 +01:00
parent 58752cea3e
commit 0fb17e41b7

View file

@ -2,6 +2,8 @@ const {
ViewNames,
generateMemoryViewID,
getMemoryViewParams,
DocumentTypes,
SEPARATOR,
} = require("../../../db/utils")
const env = require("../../../environment")
@ -10,6 +12,11 @@ exports.getView = async (db, viewName) => {
const designDoc = await db.get("_design/database")
return designDoc.views[viewName]
} else {
// This is a table view, don't read the view from the DB
if (viewName.startsWith(DocumentTypes.TABLE + SEPARATOR)) {
return null
}
const viewDoc = await db.get(generateMemoryViewID(viewName))
return viewDoc.view
}