upgrade to node 16, add search by full product id (#84)

This commit is contained in:
Anders Gustafsson
2021-11-02 10:57:11 +01:00
committed by GitHub
parent 043f1455cf
commit 0afe689200
10 changed files with 260 additions and 2892 deletions
+8
View File
@@ -240,6 +240,14 @@ export class ProductAPI extends BaseSQLDataSource {
.then((data) => data.rows.map((row) => this.createProductFromRow(row)));
}
async searchByCompleteProductId(q: string): Promise<Maybe<Product>> {
const queryAsNumber = Number(q.replaceAll('%', ''));
if (!queryAsNumber) {
return;
}
return this.getProduct(queryAsNumber);
}
async searchByBatch(name: string): Promise<Array<Batch>> {
return this.searchByFieldValue<Batch>(name, 36, 'batch');
}