@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 CHANGED
@@ -5,6 +5,9 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
+ # 2.10.15
9
+ - Readded event on fully_abandoned request
10
+
8
11
  # 2.10.14
9
12
  - Updated tybot-connector to 0.2.127
10
13
  - Restored request.js file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.10.14",
4
+ "version": "2.10.15",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
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)