diff --git a/app/controllers/api/v1/currencies.ts b/app/controllers/api/v1/currencies.ts index 86e384fd..042a39db 100644 --- a/app/controllers/api/v1/currencies.ts +++ b/app/controllers/api/v1/currencies.ts @@ -1,6 +1,34 @@ var mongoose = require("mongoose"); module.exports = function (router: any) { + router.get("/:name", async (req: any, res: any) => { + let filter = {}; + filter = { name: req.params.name.toUpperCase() }; + + let currency = await db.Currencies.findOne(filter) + .populate({ + path: "currencyAddressesByNetwork", + populate: { + path: "network", + model: "networks", + }, + }) + .populate({ + path: "currencyAddressesByNetwork", + populate: { + path: "networkDex", + populate: { + path: "dex", + model: "decentralizedExchanges", + }, + }, + }); + + return res.http200({ + currency: currency, + }); + }); + router.get("/cabn/list", async (req: any, res: any) => { var matchFilter: any = {}; var filterOrList = []; @@ -125,35 +153,6 @@ module.exports = function (router: any) { }); }); - router.get('/cabn/:name', async (req: any, res: any) => { - let filter = {} - filter = { name: req.params.name.toUpperCase() } - - let currencyAddressesByNetwork = [] - let currency = await db.Currencies.findOne(filter) - .populate({ - path: 'currencyAddressesByNetwork', - populate: { - path: 'network', - model: 'networks' - } - }) - .populate({ - path: 'currencyAddressesByNetwork', - populate: { - path: 'networkDex', - populate: { - path: 'dex', - model: 'decentralizedExchanges' - } - } - }) - - return res.http200({ - currency: currency - }); - }); - router.get("/cabn/for/fee/token/list", async (req: any, res: any) => { var matchFilter: any = {}; var filterOrList: any = [];