Add /api/customers endpoint in admin
This commit is contained in:
parent
685b327fb6
commit
f8f7f87cca
2 changed files with 13 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ const login = require('./login')
|
|||
const pairing = require('./pairing')
|
||||
const server = require('./server')
|
||||
const transactions = require('./transactions')
|
||||
const customers = require('../customers')
|
||||
const funding = require('./funding')
|
||||
|
||||
const NEVER = new Date(Date.now() + 100 * T.years)
|
||||
|
|
@ -168,6 +169,12 @@ app.patch('/api/transaction/:id', (req, res, next) => {
|
|||
.catch(() => res.status(404).send({Error: 'Not found'}))
|
||||
})
|
||||
|
||||
app.get('/api/customers', (req, res, next) => {
|
||||
return customers.batch()
|
||||
.then(r => res.send({customers: r}))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
app.use((err, req, res, next) => {
|
||||
console.error(err)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue