File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -979,6 +979,7 @@ module.exports = function (app) {
979979
980980 const _readIdeationIdeas = async ( req , res , next ) => {
981981 const ideationId = req . params . ideationId ;
982+ const search = req . query . search ;
982983 const limit = req . query . limit || 8 ;
983984 const offset = req . query . offset || 0 ;
984985 const orderBy = req . query . orderBy ;
@@ -1017,6 +1018,12 @@ module.exports = function (app) {
10171018 if ( authorId ) {
10181019 where += ` AND "Idea"."authorId" = :authorId ` ;
10191020 }
1021+ if ( search ) {
1022+ where += ` AND (
1023+ "Idea"."statement" ILIKE '%' || :search || '%' OR
1024+ "Idea"."description" ILIKE '%' || :search || '%'
1025+ ) ` ;
1026+ }
10201027 if ( status ) {
10211028 if ( status === 'draft' ) {
10221029 where += ` AND "Idea"."status" = :status ` ;
@@ -1169,6 +1176,7 @@ module.exports = function (app) {
11691176 ;
11701177 ` , {
11711178 replacements : {
1179+ search,
11721180 userId : req . user ?. id || req . user ?. userId ,
11731181 ideationId,
11741182 authorId,
You can’t perform that action at this time.
0 commit comments