Skip to content

Commit

Permalink
fix: adjust for PouchDB@5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jun 6, 2016
1 parent 9bbdd17 commit 84e03b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/utils/find-user-by-username-or-id.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module.exports = findUser

var PouchDBErrors = require('pouchdb-errors')

function findUser (db, idOrObject) {
var id = idOrObject
var username
Expand All @@ -18,7 +20,7 @@ function findUser (db, idOrObject) {
include_docs: true
}).then(function (response) {
if (response.rows.length === 0) {
throw db.constructor.Errors.MISSING_DOC
throw PouchDBErrors.MISSING_DOC
}

return response.rows[0].doc
Expand Down

0 comments on commit 84e03b8

Please sign in to comment.