In the following forkJoin code, I want requestTwo to execute only after requestOne has executed. Can this be done? From my tests, requestTwo completes before requestOne. Or is their an RxJs function that would ensure the order of execution?
forkJoin({
requestOne: this.fillOrderService.changeOrderStatus({
orderNo: this.orderNo,
orderStatus: this.orderStatus,
paymentIntent: paymentIntent,
amount: this.processingOrder?.subtotal
}),
requestTwo: this.fillOrderService.getOrders('pending'),
}).subscribe(({ requestOne, requestTwo }) => {
this.orders = requestTwo;
this.orders = this.orders.filter(order => order._id !== this.processingOrder._id)
this.processingOrder = requestOne;
this.orderNo = this.processingOrder?._id;
this.orderStatus = this.processingOrder?.status;
});