@tiledesk/tiledesk-server 2.10.14 → 2.10.15
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/routes/request.js +10 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/routes/request.js
CHANGED
@@ -30,6 +30,7 @@ csv.separator = ';';
|
|
30
30
|
|
31
31
|
const { check, validationResult } = require('express-validator');
|
32
32
|
const RoleConstants = require('../models/roleConstants');
|
33
|
+
const eventService = require('../pubmodules/events/eventService');
|
33
34
|
|
34
35
|
// var messageService = require('../services/messageService');
|
35
36
|
|
@@ -451,6 +452,11 @@ router.delete('/:requestid/participants/:participantid', function (req, res) {
|
|
451
452
|
router.put('/:requestid/assign', function (req, res) {
|
452
453
|
winston.debug(req.body);
|
453
454
|
|
455
|
+
let user = req.user;
|
456
|
+
let pu;
|
457
|
+
if (req.projectuser) {
|
458
|
+
pu = req.projectuser._id
|
459
|
+
}
|
454
460
|
// leggi la request se già assegnata o già chiusa (1000) esci
|
455
461
|
|
456
462
|
//cacheinvalidation
|
@@ -475,6 +481,10 @@ router.put('/:requestid/assign', function (req, res) {
|
|
475
481
|
|
476
482
|
winston.debug("department changed", updatedRequest);
|
477
483
|
|
484
|
+
if (updatedRequest.status === RequestConstants.ABANDONED) {
|
485
|
+
eventService.emit('request.fully_abandoned', updatedRequest, req.projectid, pu, user._id, undefined, user)
|
486
|
+
}
|
487
|
+
|
478
488
|
return res.json(updatedRequest);
|
479
489
|
}).catch(function (error) {
|
480
490
|
winston.error('Error changing the department.', error)
|