1
0
Fork 0
mirror of synced 2024-07-19 21:26:22 +12:00

Merge pull request #7200 from Budibase/fix/datasource-not-exporting

fixed pouchdb unable to find the view throwing error
This commit is contained in:
NEOLPAR 2022-08-12 15:21:01 +01:00 committed by GitHub
commit 29ea7c387c

View file

@ -20,8 +20,17 @@ exports.getView = async viewName => {
return null
}
const viewDoc = await db.get(generateMemoryViewID(viewName))
return viewDoc.view
try {
const viewDoc = await db.get(generateMemoryViewID(viewName))
return viewDoc.view
} catch (err) {
// Return null when PouchDB doesn't found the view
if (err.status === 404) {
return null
}
throw err
}
}
}