Looking to incorporate a function that verifies if a price falls within a certain range.
The data is stored in IndexedDB and I'm utilizing Dexie for data manipulation.
Currently facing issues in compiling my solution.
public checkPriceRange(customerCode: string, listCode: string, articleCode: string, price: number): Observable<any> {
this._WebDBService.Articles_List.filter(function (item){
return (item.listCode == listCode && item.articleCode == articleCode);
}).toArray().then(
result => {
if(result.length != 1)
{
return Observable.of(false)
}
else{
if(result[0].minPrice >= price && result[0].maxPrice <= price)
return Observable.of(true)
else
return Observable.of(false)
}
}
);
}
Seeking guidance on the appropriate approach to using Dexie...
Just need to verify certain fields within a row of a DexieTable, nothing complex, and return an Observable...
Appreciate the assistance.