upgrade to node 16, add search by full product id (#84)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user