aboutsummaryrefslogtreecommitdiffstats
path: root/lib/account.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-06 09:20:25 -0700
committerAdam Soltys <[email protected]>2022-09-06 09:20:25 -0700
commitc2464b2407ee23134732fd67586758dbfe18f9b5 (patch)
tree3e2d9f009bb325a9a7c4304ea02f6e64dda85bd1 /lib/account.js
parent8a080ef9a198799e7ee31cf81f92afd5495e4074 (diff)
downloadcoinos-server-c2464b2407ee23134732fd67586758dbfe18f9b5.tar.gz
coinos-server-c2464b2407ee23134732fd67586758dbfe18f9b5.zip
prettier
Diffstat (limited to 'lib/account.js')
-rw-r--r--lib/account.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/account.js b/lib/account.js
index a1f20dc7..6edb3fc1 100644
--- a/lib/account.js
+++ b/lib/account.js
@@ -1,4 +1,4 @@
-import axios from 'axios';
+import axios from "axios";
export default async (asset, user, transaction) => {
const account = await db.Account.findOne({
@@ -27,17 +27,15 @@ export default async (asset, user, transaction) => {
if (assets[asset]) {
({ domain, ticker, precision, name } = assets[asset]);
} else {
- const existing = await db.Account.findOne(
- {
- where: {
- asset
- },
- order: [["id", "ASC"]],
- limit: 1,
+ const existing = await db.Account.findOne({
+ where: {
+ asset
+ },
+ order: [["id", "ASC"]],
+ limit: 1,
lock: transaction.LOCK.UPDATE,
transaction
- },
- );
+ });
if (existing) {
({ domain, ticker, precision, name } = existing);