Add id-card compliance

This commit is contained in:
Josh Harvey 2018-02-03 14:32:05 +02:00
parent fbcb8b5ff2
commit 86dfca60c1
6 changed files with 67 additions and 210 deletions

View file

@ -177,6 +177,18 @@ function getCustomerWithPhoneCode (req, res, next) {
.catch(next)
}
function updateCustomer (req, res, next) {
const id = req.params.id
const patch = req.body
customers.getById(id)
.then(customer => {
if (!customer) { throw httpError('Not Found', 404)}
return customers.update(id, patch)
})
.then(customer => respond(req, res, {customer}))
.catch(next)
}
function getLastSeen (req, res, next) {
return logs.getLastSeen(req.deviceId)
.then(r => res.json(r))
@ -304,6 +316,8 @@ app.post('/verify_user', verifyUser)
app.post('/verify_transaction', verifyTx)
app.post('/phone_code', getCustomerWithPhoneCode)
app.patch('/customer/:id', updateCustomer)
app.post('/tx', postTx)
app.get('/tx/:id', getTx)
app.get('/tx', getPhoneTx)