I am facing an issue with my nested loop inside a function. The problem is that it is only returning the default value of false, instead of the value calculated within the loop. Can someone please point out what I might be doing incorrectly?
Provided below is my code snippet for reference. Appreciate your help.
private checkDeliveryNotesQuantity(line: SaleLine): Observable<boolean> {
return this.posSalesTableFacade.getStoreSaleBlockList$().pipe(
map((saleBlockList: SaleBlock[]) => {
saleBlockList.map(saleBlock => {
saleBlock.saleLineList.map(saleLineList => {
console.log('saleLineList', saleLineList);
return (
saleLineList.deliveryNotes &&
saleLineList.deliveryNotes.findIndex(
item => item.articleId === line.code && item.quantity >= line.missingQuantity
) >= 0
);
});
});
return false;
})
);
}