mirror of
https://github.com/chaoticbackup/chaoticbackup.github.io.git
synced 2026-08-21 08:04:18 -05:00
fixed parentheses in name search
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -47,7 +47,7 @@
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"node-sass": "^4.8.3",
|
||||
"sass-loader": "^7.0.x",
|
||||
"style-loader": "^0.21.x",
|
||||
"style-loader": "^0.22.x",
|
||||
"webpack": "^3.11",
|
||||
"webpack-dev-server": "^2.11.1"
|
||||
}
|
||||
|
||||
@@ -283,25 +283,28 @@ export default class SearchCollection extends React.Component {
|
||||
|
||||
// Search by name
|
||||
if (this.input.name.length > 0) {
|
||||
// clean name
|
||||
let inputname = this.input.name.replace(/\\/g, '').replace(/\(|\)/g, (match) => {return ("\\"+match)});
|
||||
console.log(inputname);
|
||||
attackResults = attackResults.find({'$or': [
|
||||
{'gsx$name': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$name': {'$regex': new RegExp(inputname, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(inputname, 'i')}},
|
||||
]});
|
||||
battlegearResults = battlegearResults.find({'$or': [
|
||||
{'gsx$name': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$name': {'$regex': new RegExp(inputname, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(inputname, 'i')}},
|
||||
]});
|
||||
creatureResults = creatureResults.find({'$or': [
|
||||
{'gsx$name': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$name': {'$regex': new RegExp(inputname, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(inputname, 'i')}},
|
||||
]});
|
||||
locationResults = locationResults.find({'$or': [
|
||||
{'gsx$name': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(this.input.name, 'i')}}
|
||||
{'gsx$name': {'$regex': new RegExp(inputname, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(inputname, 'i')}}
|
||||
]});
|
||||
mugicResults = mugicResults.find({'$or': [
|
||||
{'gsx$name': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(this.input.name, 'i')}},
|
||||
{'gsx$name': {'$regex': new RegExp(inputname, 'i')}},
|
||||
{'gsx$tags': {'$regex': new RegExp(inputname, 'i')}},
|
||||
]});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user