Feat: user compliance saving to DB
This commit is contained in:
parent
204e421b3d
commit
2a9e8dadba
7 changed files with 79 additions and 29 deletions
|
|
@ -13,10 +13,11 @@ const getBlacklist = () => {
|
|||
|
||||
// Delete row from blacklist table by crypto code and address
|
||||
const deleteFromBlacklist = (cryptoCode, address) => {
|
||||
return db.none(
|
||||
`DELETE FROM blacklist WHERE created_by_operator = 't' AND crypto_code = $1 AND address = $2`,
|
||||
[cryptoCode, address]
|
||||
)
|
||||
const sql = `DELETE FROM blacklist WHERE crypto_code = $1 AND address = $2;
|
||||
UPDATE notifications SET valid = 'f', read = 't' WHERE valid = 't' AND detail IN ($3^)`
|
||||
|
||||
const detail = `'${cryptoCode}_BLOCKED_${address}', '${cryptoCode}_REUSED_${address}'`
|
||||
return db.none(sql, [cryptoCode, address, detail])
|
||||
}
|
||||
|
||||
const insertIntoBlacklist = (cryptoCode, address) => {
|
||||
|
|
@ -27,12 +28,12 @@ const insertIntoBlacklist = (cryptoCode, address) => {
|
|||
)
|
||||
}
|
||||
|
||||
function blocked(address, cryptoCode) {
|
||||
function blocked (address, cryptoCode) {
|
||||
const sql = `select * from blacklist where address = $1 and crypto_code = $2`
|
||||
return db.any(sql, [address, cryptoCode])
|
||||
}
|
||||
|
||||
function addToUsedAddresses(address, cryptoCode) {
|
||||
function addToUsedAddresses (address, cryptoCode) {
|
||||
// ETH reuses addresses
|
||||
if (cryptoCode === 'ETH') return Promise.resolve()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue