Mongoose frissítve

This commit is contained in:
Vincze József 2025-02-06 15:30:02 +01:00
parent 79b54d6fb9
commit 966e240267
2 changed files with 9 additions and 7 deletions

14
app.js
View File

@ -552,19 +552,21 @@ app.post('/apiPostDailyReport/:apiKey',function(req,res){
// Munka lista lekérése és szűrése AJAX CALL
app.get('/filter', utils.ensureAuthenticated, async function(req, res) {
//console.log(req.query.year.value);
const year=new RegExp("^"+req.query.year);
const condition=new RegExp("^"+req.query.condition);
var query={
$or:[
{"megrendelo": { "$regex": req.query.condition, "$options": "i" }},
{"megrendelo": { "$regex": condition, "$options": "i" }},
{$and:
[
{"workDate": { "$regex": req.query.year, "$options": "i" }},
{"title":{ "$regex": req.query.condition, "$options": "i" }}
{"workDate": { "$regex": year, "$options": "i" }},
{"title":{ "$regex": condition, "$options": "i" }}
]
},{$and:
[
{"workDate": { "$regex": req.query.year, "$options": "i" }},
{"poNumber":{ "$regex": req.query.condition, "$options": "i" }}
{"workDate": { "$regex": year, "$options": "i" }},
{"poNumber":{ "$regex": condition, "$options": "i" }}
]
}
]

View File

@ -41,7 +41,7 @@
"lightpick": "^1.6.2",
"moment": "^2.29.1",
"moment-range": "^4.0.2",
"mongoose": "^5.11.19",
"mongoose": "^5.13.5",
"mongoose-auto-increment": "^3.0.1",
"mongoose-increment": "^2.0.0",
"multer": "^1.4.2",