Browse Source
Merge pull request #7200 from Budibase/fix/datasource-not-exporting
fixed pouchdb unable to find the view throwing error
master
NEOLPAR
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
2 deletions
-
packages/server/src/api/controllers/view/utils.js
|
|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|