Lots of development
This commit is contained in:
parent
5cbec6bd23
commit
3a244f691e
19 changed files with 594 additions and 837 deletions
|
|
@ -244,6 +244,7 @@ function fetchData () {
|
|||
{code: 'bitgo', display: 'BitGo', class: 'wallet', cryptos: ['BTC']},
|
||||
{code: 'geth', display: 'geth', class: 'wallet', cryptos: ['ETH']},
|
||||
{code: 'mock-wallet', display: 'Mock wallet', class: 'wallet', cryptos: ['BTC', 'ETH']},
|
||||
{code: 'mock-exchange', display: 'Mock exchange', class: 'exchange', cryptos: ['BTC', 'ETH']},
|
||||
{code: 'mock-sms', display: 'Mock SMS', class: 'sms'},
|
||||
{code: 'mock-id-verify', display: 'Mock ID verifier', class: 'idVerifier'},
|
||||
{code: 'twilio', display: 'Twilio', class: 'sms'},
|
||||
|
|
|
|||
|
|
@ -22,15 +22,10 @@ function unpair (rec) {
|
|||
return pairing.unpair(rec.deviceId)
|
||||
}
|
||||
|
||||
function repair (rec) {
|
||||
return pairing.repair(rec.deviceId)
|
||||
}
|
||||
|
||||
function setMachine (rec) {
|
||||
switch (rec.action) {
|
||||
case 'resetCashOutBills': return resetCashOutBills(rec)
|
||||
case 'unpair': return unpair(rec)
|
||||
case 'repair': return repair(rec)
|
||||
default: throw new Error('No such action: ' + rec.action)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,7 @@ const ALPHA_BASE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
|
|||
const bsAlpha = baseX(ALPHA_BASE)
|
||||
|
||||
function unpair (deviceId) {
|
||||
const sql = 'update devices set paired=FALSE where device_id=$1'
|
||||
|
||||
return db.none(sql, [deviceId])
|
||||
}
|
||||
|
||||
function repair (deviceId) {
|
||||
const sql = 'update devices set paired=TRUE where device_id=$1'
|
||||
|
||||
const sql = 'delete from devices where device_id=$1'
|
||||
return db.none(sql, [deviceId])
|
||||
}
|
||||
|
||||
|
|
@ -39,4 +32,4 @@ function totem (hostname, name) {
|
|||
})
|
||||
}
|
||||
|
||||
module.exports = {totem, unpair, repair}
|
||||
module.exports = {totem, unpair}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue