|
|
|
@ -81,6 +81,14 @@ module.exports = (req, res, next) => { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
//ids for newspost editing
|
|
|
|
|
if (req.params.newsid) { |
|
|
|
|
req.params.newsid = ObjectId(req.params.newsid); |
|
|
|
|
} |
|
|
|
|
if (req.body.news_id) { |
|
|
|
|
req.body.news_id = ObjectId(req.body.news_id); |
|
|
|
|
} |
|
|
|
|
//convert checked reports to number
|
|
|
|
|
if (req.body.checkedposts) { |
|
|
|
|
req.body.checkedposts = req.body.checkedposts.map(Number); |
|
|
|
@ -102,6 +110,12 @@ module.exports = (req, res, next) => { |
|
|
|
|
req.body.checkedreports = req.body.checkedreports.map(ObjectId) |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} catch (e) { |
|
|
|
|
return dynamicResponse(req, res, 400, 'message', { |
|
|
|
|
'title': 'Bad request', |
|
|
|
|
'message': 'Malformed input' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//convert duration string to time in ms
|
|
|
|
|
for (let i = 0; i < timeFields.length; i++) { |
|
|
|
@ -136,17 +150,11 @@ module.exports = (req, res, next) => { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//ids for newspost editing
|
|
|
|
|
if (req.params.newsid) { |
|
|
|
|
req.params.newsid = ObjectId(req.params.newsid); |
|
|
|
|
} |
|
|
|
|
if (req.body.news_id) { |
|
|
|
|
req.body.news_id = ObjectId(req.body.news_id); |
|
|
|
|
} |
|
|
|
|
//thread id
|
|
|
|
|
if (req.params.id) { |
|
|
|
|
req.params.id = +req.params.id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//moglog date
|
|
|
|
|
if (req.params.date) { |
|
|
|
|
let [ month, day, year ] = req.params.date.split('-'); |
|
|
|
|