Fix bug on order saving

This commit is contained in:
Rene Vergara 2022-01-31 15:32:46 -06:00
parent d61a1169fd
commit ba631ebf24

View file

@ -18,7 +18,7 @@ export class OrderService {
address: '',
session: '',
blocktime: 0,
expiration: 0,
expired: false,
pin: '',
validated: false
},
@ -193,9 +193,9 @@ export class OrderService {
closeOrder(){
this.fullnodeService.priceUpdate.subscribe((price) => {
console.log('Price:', price);
this.dataStore.order.closed = true;
this.dataStore.order.price = price;
});
this.dataStore.order.closed = true;
let obs = this.http.post<{message: string, order: Order}>(this.beUrl+'api/order', {order: this.dataStore.order}, { headers: this.reqHeaders });
obs.subscribe((orderData) => {
console.log('Closed order', orderData);
@ -219,7 +219,6 @@ export class OrderService {
this._orderUpdated.next(Object.assign({}, this.dataStore).order);
});
return obs;
});
}
}