From 62d378714f3cb61afc9003146e8a4e76649103df Mon Sep 17 00:00:00 2001 From: Soubhik Kumar Gon <119437069+mogulcoder26@users.noreply.github.com> Date: Mon, 3 Apr 2023 17:44:49 +0530 Subject: [PATCH] Update 07-params-query.js changed method for better querying --- 02-express-tutorial/final/07-params-query.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02-express-tutorial/final/07-params-query.js b/02-express-tutorial/final/07-params-query.js index fbbafb0a5c..10ef591e36 100644 --- a/02-express-tutorial/final/07-params-query.js +++ b/02-express-tutorial/final/07-params-query.js @@ -40,7 +40,7 @@ app.get('/api/v1/query', (req, res) => { if (search) { sortedProducts = sortedProducts.filter((product) => { - return product.name.startsWith(search) + return product.name.includes(search) //.includes() is a better approach to find a specified word in query string instead of .startsWith() }) } if (limit) {