1public async getFilteredItems(searchCriteria): Promise<any[]> {
2 const table = 'items';
3 const columns = ['itemName', 'itemType', 'category'];
4 const qb = (query) => {
5 for (const col of columns) {
6 query.orWhere(`${table}.${col}`, 'like', `%${searchCriteria[col]}%`);
7 }
8 }
9 return await knex(table).where(qb);
10}