From 05553e7272b58c0ef005f3696c0a43a652b21423 Mon Sep 17 00:00:00 2001 From: Philip-Jian <96810789+Philip-Jian@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:00:50 -0700 Subject: [PATCH] modify catalog query to also search host and description (#69) Co-authored-by: michellelin1 <66575725+michellelin1@users.noreply.github.com> --- routes/catalog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/catalog.js b/routes/catalog.js index 3552435..6208087 100644 --- a/routes/catalog.js +++ b/routes/catalog.js @@ -21,7 +21,9 @@ catalogRouter.get('/', async (req, res) => { const params = []; if (title) { - query += ' AND title ILIKE $1'; + query += ' AND (title ILIKE $1'; + query += ' OR host ILIKE $1'; + query += ' OR description ILIKE $1) '; params.push(`%${title}%`); } else { params.push('');