2019102152 김다빈

Modify Error where the coin name doesn't come out when user get a notification

Showing 1 changed file with 3 additions and 6 deletions
......@@ -129,14 +129,13 @@ async function get_marketName() {
}
async function transaction_coin(coin_name, side, volume, price, ord_type, first = true) {
var volume = volume;
var avg_buy_price=0,market="";
var avg_buy_price=0;
if (side == "ask") {
await User.findOne({ market: coin_name }).then((result) => {
if(volume == ""){
volume = String(result.volume);
}
avg_buy_price=result.avg_buy_price;
market=result.market.split('-')[1];
}).catch(err => { console.log(err.error) });
}
const body = {
......@@ -171,10 +170,9 @@ async function transaction_coin(coin_name, side, volume, price, ord_type, first
var my_asset = await asset(1000);
if(avg_buy_price!=0){
console.log(avg_buy_price);
lookup_order(result.uuid,avg_buy_price,market);
lookup_order(result.uuid,avg_buy_price,result.market.split("-")[1]);
}else{
lookup_order(result.uuid,0,market);
lookup_order(result.uuid,0,result.market.split("-")[1]);
}
if (side == "bid") {
if (first) {
......@@ -438,7 +436,6 @@ function trading_notice(side, price, funds, volume,yield_data=0,market) {
'Authorization': `Bearer ${TOKEN}`
},
json: {
"messages": messages
}
}, (error, response, body) => {
......