Fix bug on order saving
This commit is contained in:
parent
d61a1169fd
commit
ba631ebf24
1 changed files with 25 additions and 26 deletions
|
@ -18,7 +18,7 @@ export class OrderService {
|
||||||
address: '',
|
address: '',
|
||||||
session: '',
|
session: '',
|
||||||
blocktime: 0,
|
blocktime: 0,
|
||||||
expiration: 0,
|
expired: false,
|
||||||
pin: '',
|
pin: '',
|
||||||
validated: false
|
validated: false
|
||||||
},
|
},
|
||||||
|
@ -193,9 +193,9 @@ export class OrderService {
|
||||||
|
|
||||||
closeOrder(){
|
closeOrder(){
|
||||||
this.fullnodeService.priceUpdate.subscribe((price) => {
|
this.fullnodeService.priceUpdate.subscribe((price) => {
|
||||||
console.log('Price:', price);
|
|
||||||
this.dataStore.order.closed = true;
|
|
||||||
this.dataStore.order.price = price;
|
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 });
|
let obs = this.http.post<{message: string, order: Order}>(this.beUrl+'api/order', {order: this.dataStore.order}, { headers: this.reqHeaders });
|
||||||
obs.subscribe((orderData) => {
|
obs.subscribe((orderData) => {
|
||||||
console.log('Closed order', orderData);
|
console.log('Closed order', orderData);
|
||||||
|
@ -219,7 +219,6 @@ export class OrderService {
|
||||||
this._orderUpdated.next(Object.assign({}, this.dataStore).order);
|
this._orderUpdated.next(Object.assign({}, this.dataStore).order);
|
||||||
});
|
});
|
||||||
return obs;
|
return obs;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue