Feat: move notif center fns to own file on the notifier module

Fix: fix jest test
This commit is contained in:
Cesar 2021-01-20 14:37:34 +00:00 committed by Josh Harvey
parent 34f2b84fe2
commit 69d3e4cb9b
6 changed files with 204 additions and 190 deletions

View file

@ -1,5 +1,5 @@
const db = require('./db')
const notifier = require('./notifier')
const notifierQueries = require('./notifier/queries')
// Get all blacklist rows from the DB "blacklist" table that were manually inserted by the operator
const getBlacklist = () => {
@ -15,7 +15,7 @@ const getBlacklist = () => {
// Delete row from blacklist table by crypto code and address
const deleteFromBlacklist = (cryptoCode, address) => {
const sql = `DELETE FROM blacklist WHERE crypto_code = $1 AND address = $2`
notifier.clearBlacklistNotification(cryptoCode, address)
notifierQueries.clearBlacklistNotification(cryptoCode, address).catch(console.error)
return db.none(sql, [cryptoCode, address])
}