Fix: blacklist modal not opening
Fix: no more fetching of non operator added addresses for blacklisted addresses table. Fix: trim address white spaces before sending it to database query
This commit is contained in:
parent
e381efed6d
commit
0cd14ba398
3 changed files with 4 additions and 4 deletions
|
|
@ -1,8 +1,8 @@
|
|||
const db = require('./db')
|
||||
|
||||
// Get all blacklist rows from the DB "blacklist" table
|
||||
// Get all blacklist rows from the DB "blacklist" table that were manually inserted by the operator
|
||||
const getBlacklist = () => {
|
||||
return db.any('select * from blacklist').then(res =>
|
||||
return db.any(`SELECT * FROM blacklist WHERE created_by_operator = 't'`).then(res =>
|
||||
res.map(item => ({
|
||||
cryptoCode: item.crypto_code,
|
||||
address: item.address,
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ const Blacklist = () => {
|
|||
return (
|
||||
<>
|
||||
<TitleSection title="Blacklisted addresses">
|
||||
<Link onClick={() => setShowModal(false)}>Blacklist new addresses</Link>
|
||||
<Link onClick={() => setShowModal(true)}>Blacklist new addresses</Link>
|
||||
</TitleSection>
|
||||
<Grid container className={classes.grid}>
|
||||
<Sidebar
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ const BlackListModal = ({ onClose, selectedCoin, addToBlacklist }) => {
|
|||
.required('An address is required')
|
||||
})}
|
||||
onSubmit={({ address }, { resetForm }) => {
|
||||
handleAddToBlacklist(address)
|
||||
handleAddToBlacklist(address.trim())
|
||||
resetForm()
|
||||
}}>
|
||||
<Form id="address-form">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue