diff --git a/db-server/index.js b/db-server/index.js index ef709b7..2a235f8 100644 --- a/db-server/index.js +++ b/db-server/index.js @@ -94,7 +94,7 @@ function createServer(db) { api.post('/account/:id/emails', withIdAndBody(db.createEmail)) api.del('/account/:id/emails/:email', op(function (req) { - return db.deleteEmail(req.params.id, req.params.email) + return db.deleteEmail(req.params.id, Buffer(req.params.email, 'hex').toString('utf8')) }) ) diff --git a/db-server/test/backend/remote.js b/db-server/test/backend/remote.js index 25e57f1..145d1c4 100644 --- a/db-server/test/backend/remote.js +++ b/db-server/test/backend/remote.js @@ -192,7 +192,7 @@ module.exports = function(cfg, makeServer) { assert.equal(!! result[2].isPrimary, false, 'isPrimary is false on thirdEmailRecord email') assert.equal(!! result[2].isVerified, false, 'matches secondEmail thirdEmailRecord') - return client.delThen('/account/' + user.accountId + '/emails/' + secondEmailRecord.email) + return client.delThen('/account/' + user.accountId + '/emails/' + emailToHex(secondEmailRecord.email)) }) .then(function (r) { respOkEmpty(r)