aboutsummaryrefslogtreecommitdiffstats
path: root/routes/send.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-07-27 10:03:59 -0700
committerAdam Soltys <[email protected]>2020-07-27 10:04:02 -0700
commitbfb643b82b559cb4ee78c6501d339920c6df8176 (patch)
tree8cafe80075e0bc5b2ec35e0e4def91046ddcd532 /routes/send.js
parent768bcc0107c98d145d4a663e8562a13666570941 (diff)
downloadcoinos-server-bfb643b82b559cb4ee78c6501d339920c6df8176.tar.gz
coinos-server-bfb643b82b559cb4ee78c6501d339920c6df8176.zip
add domain field to assets
Diffstat (limited to 'routes/send.js')
-rw-r--r--routes/send.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/routes/send.js b/routes/send.js
index f774e852..2fad326d 100644
--- a/routes/send.js
+++ b/routes/send.js
@@ -73,6 +73,7 @@ module.exports = async (req, res) => {
await account.save({ transaction });
} else {
let name = asset.substr(0, 6);
+ let domain;
let ticker = asset.substr(0, 3).toUpperCase();
let precision = 8;
@@ -80,7 +81,7 @@ module.exports = async (req, res) => {
.data;
if (assets[asset]) {
- ({ ticker, precision, name } = assets[asset]);
+ ({ domain, ticker, precision, name } = assets[asset]);
} else {
const existing = await db.Account.findOne({
where: {
@@ -93,12 +94,11 @@ module.exports = async (req, res) => {
l.info("existing", existing);
if (existing) {
- l.info(existing.name);
- ({ ticker, precision, name } = existing);
+ ({ domain, ticker, precision, name } = existing);
}
}
- params = { ...params, ...{ ticker, precision, name } };
+ params = { ...params, ...{ domain, ticker, precision, name } };
params.balance = amount;
params.pending = 0;
account = await db.Account.create(params, { transaction });