fix table view export in prod
This commit is contained in:
parent
58752cea3e
commit
0fb17e41b7
|
@ -2,6 +2,8 @@ const {
|
||||||
ViewNames,
|
ViewNames,
|
||||||
generateMemoryViewID,
|
generateMemoryViewID,
|
||||||
getMemoryViewParams,
|
getMemoryViewParams,
|
||||||
|
DocumentTypes,
|
||||||
|
SEPARATOR,
|
||||||
} = require("../../../db/utils")
|
} = require("../../../db/utils")
|
||||||
const env = require("../../../environment")
|
const env = require("../../../environment")
|
||||||
|
|
||||||
|
@ -10,6 +12,11 @@ exports.getView = async (db, viewName) => {
|
||||||
const designDoc = await db.get("_design/database")
|
const designDoc = await db.get("_design/database")
|
||||||
return designDoc.views[viewName]
|
return designDoc.views[viewName]
|
||||||
} else {
|
} 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))
|
const viewDoc = await db.get(generateMemoryViewID(viewName))
|
||||||
return viewDoc.view
|
return viewDoc.view
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue