[Pool page] - Parse regexes and addresses in the backend
This commit is contained in:
parent
1e96c93557
commit
fa8607c57d
@ -63,6 +63,9 @@ class PoolsRepository {
|
|||||||
const [rows] = await connection.query(query, [poolId]);
|
const [rows] = await connection.query(query, [poolId]);
|
||||||
connection.release();
|
connection.release();
|
||||||
|
|
||||||
|
rows[0].regexes = JSON.parse(rows[0].regexes);
|
||||||
|
rows[0].addresses = JSON.parse(rows[0].addresses);
|
||||||
|
|
||||||
return rows[0];
|
return rows[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,11 +49,11 @@ export class PoolComponent implements OnInit {
|
|||||||
}),
|
}),
|
||||||
map((poolStats) => {
|
map((poolStats) => {
|
||||||
let regexes = '"';
|
let regexes = '"';
|
||||||
for (const regex of JSON.parse(poolStats.pool.regexes)) {
|
for (const regex of poolStats.pool.regexes) {
|
||||||
regexes += regex + '", "';
|
regexes += regex + '", "';
|
||||||
}
|
}
|
||||||
poolStats.pool.regexes = regexes.slice(0, -3);
|
poolStats.pool.regexes = regexes.slice(0, -3);
|
||||||
poolStats.pool.addresses = JSON.parse(poolStats.pool.addresses);
|
poolStats.pool.addresses = poolStats.pool.addresses;
|
||||||
|
|
||||||
return Object.assign({
|
return Object.assign({
|
||||||
logo: `./resources/mining-pools/` + poolStats.pool.name.toLowerCase().replace(' ', '').replace('.', '') + '.svg'
|
logo: `./resources/mining-pools/` + poolStats.pool.name.toLowerCase().replace(' ', '').replace('.', '') + '.svg'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user