Skip to content

Commit

Permalink
corrijo regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mpvaldez committed Jun 6, 2023
1 parent bcdfc03 commit 593ac15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/lib/api/topics/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const queryTopics = (opts) => {
if (related && related.length > 0) query['attrs.admin-comment-referencia'] = { $regex: `.*${related}.*` }

if (years && years.length > 0) query.$or = years.map(year => ({createdAt: {$gte: new Date(year,0,1),$lte: new Date(year,11,31)}}))
if (kwords && kwords.length > 0) query.mediaTitle = { $in: kwords.map(regex => new RegExp(regex))}
if (kwords && kwords.length > 0) query.mediaTitle = { $in: kwords.map(kword => new RegExp(`.*${kword}.*`, 'i'))}
// console.log(kwords)
// if (years && years.length > 0) query.$where = function (){
// const year = this.createdAt.getFullYear().toString()
Expand Down

0 comments on commit 593ac15

Please sign in to comment.