From c680b363734a9dc079e1c92a5a198038572e119f Mon Sep 17 00:00:00 2001 From: Danu Widatama Date: Thu, 4 Apr 2024 13:25:23 +0700 Subject: [PATCH] [star-rating] Enable email search for feedback --- plugins/star-rating/api/api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/star-rating/api/api.js b/plugins/star-rating/api/api.js index 574cf556fb5..eeb1cca4135 100644 --- a/plugins/star-rating/api/api.js +++ b/plugins/star-rating/api/api.js @@ -1041,7 +1041,10 @@ function uploadFile(myfile, id, callback) { query.device_id = params.qstring.device_id; } if (params.qstring.sSearch && params.qstring.sSearch !== "") { - query.comment = {"$regex": new RegExp(".*" + params.qstring.sSearch + ".*", 'i')}; + query.$or = [ + { comment: {$regex: new RegExp(`.*${params.qstring.sSearch}.*`, 'i')} }, + { email: {$regex: new RegExp(`.*${params.qstring.sSearch}.*`, 'i')} }, + ]; } if (params.qstring.iSortCol_0) { try {