Add transaction versioning, tx cancellation (#79)
This commit is contained in:
parent
4a97535dec
commit
500edcf279
15 changed files with 2223 additions and 1468 deletions
|
|
@ -15,6 +15,7 @@ const plugins = require('./plugins')
|
|||
const helpers = require('./route-helpers')
|
||||
const poller = require('./poller')
|
||||
const Tx = require('./tx')
|
||||
const E = require('./error')
|
||||
|
||||
const argv = require('minimist')(process.argv.slice(2))
|
||||
|
||||
|
|
@ -108,6 +109,10 @@ function postTx (req, res, next) {
|
|||
|
||||
return res.json(tx)
|
||||
})
|
||||
.catch(err => {
|
||||
if (err instanceof E.StaleTxError) return res.status(404).json({})
|
||||
throw err
|
||||
})
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +275,11 @@ app.get('/tx/:id', getTx)
|
|||
app.get('/tx', getPhoneTx)
|
||||
|
||||
app.use(errorHandler)
|
||||
app.use((req, res) => res.status(404).json({error: 'No such route'}))
|
||||
app.use((req, res) => {
|
||||
console.log('DEBUG98')
|
||||
console.log(req.route)
|
||||
res.status(404).json({error: 'No such route'})
|
||||
})
|
||||
|
||||
localApp.get('/pid', (req, res) => {
|
||||
const deviceId = req.query.device_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue