@tiledesk/tiledesk-server 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +12 -0
- package/README.md +16 -4
- package/app.js +2 -2
- package/channels/chat21/chat21WebHook.js +12 -1
- package/event/botEvent.js +1 -1
- package/fonts/Roboto-Italic.ttf +0 -0
- package/fonts/Roboto-Medium.ttf +0 -0
- package/fonts/Roboto-MediumItalic.ttf +0 -0
- package/fonts/Roboto-Regular.ttf +0 -0
- package/middleware/passport.js +4 -1
- package/models/lead.js +2 -0
- package/models/request.js +38 -11
- package/package.json +3 -2
- package/pubmodules/activities/test/activityRoute.js +4 -4
- package/pubmodules/messageActions/messageActionsInterceptor.js +4 -2
- package/pubmodules/scheduler/tasks/closeAgentUnresponsiveRequestTask.js +3 -1
- package/pubmodules/scheduler/tasks/closeBotUnresponsiveRequestTask.js +3 -1
- package/pubmodules/trigger/rulesTrigger.js +3 -2
- package/routes/lead.js +24 -1
- package/routes/message.js +6 -3
- package/routes/public-request.js +265 -2
- package/routes/request.js +83 -11
- package/routes/user-request.js +3 -2
- package/routes/widget.js +16 -1
- package/routes/widgetLoader.js +31 -0
- package/services/requestService.js +364 -6
- package/test/messageRoute.js +69 -0
- package/test/requestService.js +3 -1
- package/models/subscriptionEvent.js +0 -11
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
|
2
2
|
|
3
|
+
# 2.3.1
|
4
|
+
- changed tiledesk logo for emails
|
5
|
+
- open modules: analytics, activity log, multi tenancy, departments, groups, canned responses, tags, triggers, webhooks
|
6
|
+
|
7
|
+
# 2.2.39
|
8
|
+
- Added enterprise module
|
9
|
+
- Log fix
|
10
|
+
- Added DISABLE_MONGO_PASSWORD_MASK env variable
|
11
|
+
- Embedded rasa proxy
|
12
|
+
- Added Swedish, Uzbek and Kazakh languages
|
13
|
+
- Added Azerbaijani language
|
14
|
+
|
3
15
|
# 2.2.38
|
4
16
|
- Unlocked departments, groups, multi-tenant, tags and canned resposes modules
|
5
17
|
|
package/README.md
CHANGED
@@ -9,11 +9,23 @@
|
|
9
9
|
|
10
10
|
# Introduction
|
11
11
|
|
12
|
-
Tiledesk-server is the server engine of Tiledesk. Tiledesk is an Open Source Live Chat platform with integrated
|
12
|
+
Tiledesk-server is the server engine of Tiledesk. Tiledesk is an Open Source Live Chat platform with integrated Chatbots written in NodeJs and Express. Build your own customer support with a multi-channel platform for Web, Android and iOS.
|
13
13
|
|
14
|
-
|
14
|
+
Designed to be open source since the beginning, we actively worked on it to create a totally new, first class customer service platform based on instant messaging.
|
15
15
|
|
16
|
-
|
16
|
+
What is Tiledesk today? It became the open source “conversational app development” platform that everyone needs 😌
|
17
|
+
|
18
|
+
You can use Tiledesk to increase sales for your website or for post-sales customer service. Every conversation can be automated using our first class native chatbot technology.
|
19
|
+
You can also connect your own applications using our APIs or Webhooks.
|
20
|
+
Moreover you can deploy entire visual applications inside a conversation. And your applications can converse with your chatbots or your end-users! We know this is cool 😎
|
21
|
+
|
22
|
+
Tiledesk is multichannel in a totally new way. You can write your chatbot scripts with images, buttons and other cool elements that your channels support. But you will configureyour chatbot replies only once. They will run on every channel, auto-adapting the responses to the target channel whatever it is, Whatsapp, Facebook Messenger, Telegram etc.
|
23
|
+
|
24
|
+
More info on Tiledesk website: https://www.tiledesk.com.
|
25
|
+
|
26
|
+
You can find technical documentation here: https://developer.tiledesk.com
|
27
|
+
|
28
|
+
# Prerequisites for Installation
|
17
29
|
|
18
30
|
* [Nodejs](https://www.npmjs.com/) and npm installed. Suggested versions are NodeJS 12.20.2 and NPM 6.14.11
|
19
31
|
* [MongoDb](https://www.mongodb.com) installed
|
@@ -81,7 +93,7 @@ Deploy with button:
|
|
81
93
|
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Tiledesk/tiledesk-server)
|
82
94
|
|
83
95
|
# Community? Questions? Support ?
|
84
|
-
If you need help or just want to hang out, come, say hi on our [Discord](https://discord.gg/
|
96
|
+
If you need help or just want to hang out, come, say hi on our [<img width="15" alt="Tiledesk discord" src="https://seeklogo.com/images/D/discord-color-logo-E5E6DFEF80-seeklogo.com.png"> Discord](https://discord.gg/nERZEZ7SmG) server.
|
85
97
|
|
86
98
|
# REST API
|
87
99
|
|
package/app.js
CHANGED
@@ -175,8 +175,6 @@ if (process.env.CREATE_INITIAL_DATA !== "false") {
|
|
175
175
|
|
176
176
|
|
177
177
|
|
178
|
-
|
179
|
-
|
180
178
|
var app = express();
|
181
179
|
|
182
180
|
|
@@ -404,6 +402,8 @@ app.use('/auth', auth);
|
|
404
402
|
app.use('/testauth', [passport.authenticate(['basic', 'jwt'], { session: false }), validtoken], authtest);
|
405
403
|
|
406
404
|
app.use('/widgets', widgetsLoader);
|
405
|
+
app.use('/w', widgetsLoader);
|
406
|
+
|
407
407
|
app.use('/images', images);
|
408
408
|
app.use('/files', files);
|
409
409
|
app.use('/urls', urls);
|
@@ -201,12 +201,21 @@ router.post('/', function (req, res) {
|
|
201
201
|
return winston.error("project_user not found with query: ", queryProjectUser);
|
202
202
|
}
|
203
203
|
|
204
|
+
|
205
|
+
// var auto_close;
|
206
|
+
|
207
|
+
// // qui projecy nn c'è devi leggerlo
|
208
|
+
// if (req.project.attributes.auto_close === false) {
|
209
|
+
// auto_close = 10;
|
210
|
+
// }
|
211
|
+
|
204
212
|
|
205
213
|
var new_request = {
|
206
214
|
request_id: message.recipient, project_user_id:project_user_id, lead_id:createdLead._id, id_project:projectid, first_text:message.text,
|
207
215
|
departmentid:departmentid, sourcePage:sourcePage, language:language, userAgent:client, status:requestStatus, createdBy: undefined,
|
208
216
|
attributes:rAttributes, subject:undefined, preflight:false, channel:undefined, location:undefined,
|
209
217
|
lead:createdLead, requester:project_user
|
218
|
+
// , auto_close: auto_close
|
210
219
|
};
|
211
220
|
|
212
221
|
winston.debug("new_request", new_request);
|
@@ -398,7 +407,9 @@ router.post('/', function (req, res) {
|
|
398
407
|
// winston.debug('updatedParticipantsRequest', updatedParticipantsRequest);
|
399
408
|
// manca id
|
400
409
|
|
401
|
-
|
410
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
411
|
+
const closed_by = user_id;
|
412
|
+
return requestService.closeRequestByRequestId(recipient_id, projectId, false, true,closed_by ).then(function(updatedStatusRequest) {
|
402
413
|
|
403
414
|
winston.debug('updatedStatusRequest', updatedStatusRequest.toObject());
|
404
415
|
return res.json(updatedStatusRequest);
|
package/event/botEvent.js
CHANGED
@@ -123,7 +123,7 @@ messageEvent.on('message.create', function(message) {
|
|
123
123
|
if (bot.type==="internal") {
|
124
124
|
botEvent.emit('bot.message.received.notify.internal', message);
|
125
125
|
|
126
|
-
}else {
|
126
|
+
}else { //external
|
127
127
|
if (bot.url) {
|
128
128
|
var botNotification = {bot: bot, message: message};
|
129
129
|
botEvent.emit('bot.message.received.notify.external', botNotification);
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/middleware/passport.js
CHANGED
@@ -83,9 +83,12 @@ module.exports = function(passport) {
|
|
83
83
|
// qui arriva questo
|
84
84
|
// decoded: {"_id":"5ce3ee855c520200176c189e","updatedAt":"2019-05-31T09:50:22.949Z","createdAt":"2019-05-21T12:26:45.192Z","name":"botext","url":"https://tiledesk-v2-simple--andrealeo83.repl.co","id_project":"5ce3d1ceb25ad30017274bc5","trashed":false,"createdBy":"5ce3d1c7b25ad30017274bc2","__v":0,"external":true,"iat":1559297130,"aud":"https://tiledesk.com","iss":"https://tiledesk.com","sub":"5ce3ee855c520200176c189e@tiledesk.com/bot"}
|
85
85
|
|
86
|
-
winston.debug("decoded.aud: "+ decoded.aud );
|
87
86
|
|
88
87
|
if (decoded && decoded.aud) {
|
88
|
+
|
89
|
+
winston.debug("decoded.aud: "+ decoded.aud );
|
90
|
+
|
91
|
+
|
89
92
|
const audUrl = new URL(decoded.aud);
|
90
93
|
winston.debug("audUrl: "+ audUrl );
|
91
94
|
const path = audUrl.pathname;
|
package/models/lead.js
CHANGED
@@ -96,6 +96,8 @@ var LeadSchema = new Schema({
|
|
96
96
|
LeadSchema.index({fullname: 'text', email: 'text'},
|
97
97
|
{"name":"lead_fulltext","default_language": defaultFullTextLanguage,"language_override": "dummy"}); // schema level
|
98
98
|
|
99
|
+
// suggested by atlas
|
100
|
+
LeadSchema.index({status: 1, id_project: 1, createdAt: -1});
|
99
101
|
|
100
102
|
var lead = mongoose.model('lead', LeadSchema);
|
101
103
|
|
package/models/request.js
CHANGED
@@ -58,7 +58,7 @@ var RequestSchema = new Schema({
|
|
58
58
|
type: Schema.Types.ObjectId,
|
59
59
|
ref: 'project_user',
|
60
60
|
required: false, //ENABLEIT,
|
61
|
-
index: true
|
61
|
+
// index: true //unused
|
62
62
|
},
|
63
63
|
|
64
64
|
|
@@ -100,7 +100,7 @@ var RequestSchema = new Schema({
|
|
100
100
|
type: Number,
|
101
101
|
required: false,
|
102
102
|
default: RequestConstants.UNASSIGNED,
|
103
|
-
index: true
|
103
|
+
// index: true //unused
|
104
104
|
},
|
105
105
|
|
106
106
|
|
@@ -134,17 +134,20 @@ var RequestSchema = new Schema({
|
|
134
134
|
index: true,
|
135
135
|
default: "medium" //translate on client side
|
136
136
|
},
|
137
|
-
|
137
|
+
|
138
|
+
followers: [{
|
139
|
+
type: Schema.Types.ObjectId,
|
140
|
+
ref: 'project_user' }],
|
138
141
|
|
139
142
|
participantsAgents: {
|
140
143
|
type: Array,
|
141
144
|
required: false,
|
142
|
-
index: true,
|
145
|
+
// index: true, //i think unused
|
143
146
|
},
|
144
147
|
participantsBots: {
|
145
148
|
type: Array,
|
146
149
|
required: false,
|
147
|
-
index: true,
|
150
|
+
// index: true, //i think unused
|
148
151
|
},
|
149
152
|
department: {
|
150
153
|
type: Schema.Types.ObjectId,
|
@@ -161,20 +164,20 @@ var RequestSchema = new Schema({
|
|
161
164
|
// First reply time is the time between ticket creation and the first public comment from an agent, displayed in minutes. Some qualifications include:
|
162
165
|
first_response_at: {
|
163
166
|
type: Date,
|
164
|
-
index: true
|
167
|
+
// index: true // unused
|
165
168
|
},
|
166
169
|
|
167
170
|
//timestamp when the agent reply the first time to a visitor
|
168
171
|
assigned_at: {
|
169
172
|
type: Date,
|
170
|
-
index: true
|
173
|
+
// index: true //unused
|
171
174
|
},
|
172
175
|
|
173
176
|
// Wait Time (Average and Longest): The average and longest times visitors have been waiting for their chats to be served.
|
174
177
|
// Wait time is calculated as duration between the first visitor message in the chat and the first agent message. Wait time will be 0 for agent initiated or trigger initiated chats.
|
175
178
|
waiting_time: {
|
176
179
|
type: Number,
|
177
|
-
index: true
|
180
|
+
// index: true // why?
|
178
181
|
},
|
179
182
|
|
180
183
|
|
@@ -187,9 +190,12 @@ var RequestSchema = new Schema({
|
|
187
190
|
// default: 0
|
188
191
|
// },
|
189
192
|
|
190
|
-
closed_at: {
|
193
|
+
closed_at: {
|
191
194
|
type: Date
|
192
195
|
},
|
196
|
+
closed_by: {
|
197
|
+
type: String
|
198
|
+
},
|
193
199
|
|
194
200
|
tags: [TagSchema],
|
195
201
|
|
@@ -205,7 +211,11 @@ var RequestSchema = new Schema({
|
|
205
211
|
},
|
206
212
|
snapshot: {
|
207
213
|
type: RequestSnapshotSchema,
|
208
|
-
select: true
|
214
|
+
select: true,
|
215
|
+
//index: false,
|
216
|
+
// includeIndices: false,
|
217
|
+
excludeIndexes: true //testa bene
|
218
|
+
|
209
219
|
// select: false
|
210
220
|
},
|
211
221
|
|
@@ -254,7 +264,10 @@ var RequestSchema = new Schema({
|
|
254
264
|
required: false
|
255
265
|
},
|
256
266
|
location: LocationSchema,
|
257
|
-
|
267
|
+
auto_close: {
|
268
|
+
type: Number,
|
269
|
+
index: true
|
270
|
+
},
|
258
271
|
id_project: {
|
259
272
|
type: String,
|
260
273
|
required: true,
|
@@ -434,8 +447,22 @@ RequestSchema.index({ id_project: 1, preflight:1, updatedAt: -1 }); // used quer
|
|
434
447
|
|
435
448
|
RequestSchema.index({ hasBot: 1, createdAt: 1 }); // suggested by atlas
|
436
449
|
|
450
|
+
// suggested by atlas
|
451
|
+
RequestSchema.index({ lead: 1, id_project: 1, participants: 1, preflight: 1, createdAt: -1 });
|
452
|
+
// suggested by atlas
|
453
|
+
RequestSchema.index({ lead: 1, id_project: 1, preflight: 1, createdAt: -1 });
|
454
|
+
|
455
|
+
// suggested by atlas
|
456
|
+
RequestSchema.index({ lead: 1, "snapshot.agents.id_user": 1, id_project: 1, preflight: 1, createdAt: -1 });
|
457
|
+
|
458
|
+
// suggested by atlas
|
437
459
|
RequestSchema.index({ id_project: 1, ticket_id: 1 });
|
438
460
|
|
461
|
+
// suggested by atlas
|
462
|
+
RequestSchema.index({ id_project: 1, createdAt: 1, preflight: 1});
|
463
|
+
|
464
|
+
//suggested by atlas profiler. Used by auto closing requests
|
465
|
+
RequestSchema.index({ hasBot: 1, status: 1, createdAt: 1});
|
439
466
|
|
440
467
|
|
441
468
|
// cannot index parallel arrays [agents] [participants] {"driv
|
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.3.
|
4
|
+
"version": "2.3.2",
|
5
5
|
"scripts": {
|
6
6
|
"start": "node ./bin/www",
|
7
7
|
"pretest": "mongodb-runner start",
|
@@ -42,8 +42,8 @@
|
|
42
42
|
"dependencies": {
|
43
43
|
"@tiledesk/tiledesk-chat21-app": "^1.1.4",
|
44
44
|
"@tiledesk/tiledesk-chatbot-util": "^0.8.33",
|
45
|
-
"@tiledesk/tiledesk-rasa-connector": "^1.0.5",
|
46
45
|
"@tiledesk/tiledesk-json-rules-engine": "^4.0.3",
|
46
|
+
"@tiledesk/tiledesk-rasa-connector": "^1.0.7",
|
47
47
|
"app-root-path": "^3.0.0",
|
48
48
|
"bcrypt-nodejs": "0.0.3",
|
49
49
|
"body-parser": "^1.20.0",
|
@@ -86,6 +86,7 @@
|
|
86
86
|
"passport": "^0.4.1",
|
87
87
|
"passport-http": "^0.3.0",
|
88
88
|
"passport-jwt": "^4.0.0",
|
89
|
+
"pdfmake": "^0.2.5",
|
89
90
|
"promise-events": "^0.2.4",
|
90
91
|
"request": "^2.88.2",
|
91
92
|
"request-promise": "^4.2.6",
|
@@ -2,15 +2,15 @@
|
|
2
2
|
process.env.NODE_ENV = 'test';
|
3
3
|
|
4
4
|
var Activity = require('../models/activity');
|
5
|
-
var projectService = require('
|
6
|
-
var userService = require('
|
5
|
+
var projectService = require('../../../services/projectService');
|
6
|
+
var userService = require('../../../services/userService');
|
7
7
|
|
8
8
|
//Require the dev-dependencies
|
9
9
|
let chai = require('chai');
|
10
10
|
let chaiHttp = require('chai-http');
|
11
|
-
let server = require('
|
11
|
+
let server = require('../../../app');
|
12
12
|
let should = chai.should();
|
13
|
-
var winston = require('
|
13
|
+
var winston = require('../../../config/winston');
|
14
14
|
|
15
15
|
// chai.config.includeStack = true;
|
16
16
|
|
@@ -149,8 +149,10 @@ class MessageActionsInterceptor {
|
|
149
149
|
if (request) {
|
150
150
|
// setTimeout(function() {
|
151
151
|
// winston.info("delayed")
|
152
|
-
|
153
|
-
|
152
|
+
|
153
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
154
|
+
const closed_by = message.sender;
|
155
|
+
requestService.closeRequestByRequestId(request.request_id, request.id_project, false, true, closed_by );
|
154
156
|
// }, 1500);
|
155
157
|
|
156
158
|
|
@@ -84,7 +84,9 @@ findUnresponsiveRequests() {
|
|
84
84
|
requests.forEach(request => {
|
85
85
|
winston.debug("********unresponsive request ", request);
|
86
86
|
|
87
|
-
|
87
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
88
|
+
const closed_by = "_bot_unresponsive";
|
89
|
+
return requestService.closeRequestByRequestId(request.request_id, request.id_project, false, false, closed_by).then(function(updatedStatusRequest) {
|
88
90
|
winston.verbose("CloseAgentUnresponsiveRequestTask: Request closed with request_id: " + request.request_id);
|
89
91
|
// winston.info("Request closed",updatedStatusRequest);
|
90
92
|
}).catch(function(err) {
|
@@ -95,7 +95,9 @@ findUnresponsiveRequests() {
|
|
95
95
|
|
96
96
|
winston.debug("********unresponsive request ", request);
|
97
97
|
|
98
|
-
|
98
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
99
|
+
const closed_by = "_bot_unresponsive";
|
100
|
+
return requestService.closeRequestByRequestId(request.request_id, request.id_project, false, false, closed_by).then(function(updatedStatusRequest) {
|
99
101
|
winston.info("CloseBotUnresponsiveRequestTask: Request closed with request_id: " + request.request_id);
|
100
102
|
// winston.info("Request closed",updatedStatusRequest);
|
101
103
|
}).catch(function(err) {
|
@@ -341,8 +341,9 @@ class RulesTrigger {
|
|
341
341
|
var id_project = eventTrigger.event.id_project;
|
342
342
|
winston.debug('runAction action id_project: ' + id_project);
|
343
343
|
|
344
|
-
//
|
345
|
-
|
344
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
345
|
+
const closed_by = "_trigger";
|
346
|
+
requestService.closeRequestByRequestId(request_id, id_project, false, true, closed_by);
|
346
347
|
|
347
348
|
} catch(e) {
|
348
349
|
winston.error("Error runAction", e);
|
package/routes/lead.js
CHANGED
@@ -80,6 +80,15 @@ router.put('/:leadid', function (req, res) {
|
|
80
80
|
|
81
81
|
|
82
82
|
leadEvent.emit('lead.update', updatedLead);
|
83
|
+
|
84
|
+
if (req.body.fullname!=undefined) {
|
85
|
+
leadEvent.emit('lead.fullname.update', updatedLead);
|
86
|
+
}
|
87
|
+
|
88
|
+
if (req.body.email!=undefined) {
|
89
|
+
leadEvent.emit('lead.email.update', updatedLead);
|
90
|
+
}
|
91
|
+
|
83
92
|
res.json(updatedLead);
|
84
93
|
});
|
85
94
|
});
|
@@ -187,6 +196,11 @@ router.get('/csv', function (req, res, next) {
|
|
187
196
|
|
188
197
|
winston.debug("sort query", sortQuery);
|
189
198
|
|
199
|
+
// TODO ORDER BY SCORE
|
200
|
+
// return Faq.find(query, {score: { $meta: "textScore" } })
|
201
|
+
// .sort( { score: { $meta: "textScore" } } ) //https://docs.mongodb.com/manual/reference/operator/query/text/#sort-by-text-search-score
|
202
|
+
|
203
|
+
|
190
204
|
// Lead.find({ "id_project": req.projectid }, function (err, leads, next) {
|
191
205
|
return Lead.find(query, '-attributes -__v').
|
192
206
|
skip(skip).limit(limit).
|
@@ -258,6 +272,8 @@ router.get('/', function (req, res) {
|
|
258
272
|
query.fullname = { "$exists": true };
|
259
273
|
}
|
260
274
|
|
275
|
+
// aggiungi filtro per data
|
276
|
+
|
261
277
|
if (req.query.status) {
|
262
278
|
query.status = req.query.status;
|
263
279
|
}
|
@@ -277,6 +293,13 @@ router.get('/', function (req, res) {
|
|
277
293
|
|
278
294
|
winston.debug("sort query", sortQuery);
|
279
295
|
|
296
|
+
// TODO ORDER BY SCORE
|
297
|
+
// return Faq.find(query, {score: { $meta: "textScore" } })
|
298
|
+
// .sort( { score: { $meta: "textScore" } } ) //https://docs.mongodb.com/manual/reference/operator/query/text/#sort-by-text-search-score
|
299
|
+
|
300
|
+
|
301
|
+
// aggiungi filtro per data marco
|
302
|
+
|
280
303
|
return Lead.find(query).
|
281
304
|
skip(skip).limit(limit).
|
282
305
|
sort(sortQuery).
|
@@ -288,7 +311,7 @@ router.get('/', function (req, res) {
|
|
288
311
|
|
289
312
|
// blocked to 1000 TODO increases it
|
290
313
|
// collection.count is deprecated, and will be removed in a future version. Use Collection.countDocuments or Collection.estimatedDocumentCount instead
|
291
|
-
return Lead.
|
314
|
+
return Lead.countDocuments(query, function (err, totalRowCount) {
|
292
315
|
|
293
316
|
var objectToReturn = {
|
294
317
|
perPage: limit,
|
package/routes/message.js
CHANGED
@@ -51,6 +51,7 @@ async (req, res) => {
|
|
51
51
|
return res.status(422).json({ errors: errors.array() });
|
52
52
|
}
|
53
53
|
|
54
|
+
|
54
55
|
var project_user = req.projectuser;
|
55
56
|
var sender = req.body.sender;
|
56
57
|
var fullname = req.body.senderFullname || req.user.fullName;
|
@@ -159,7 +160,8 @@ async (req, res) => {
|
|
159
160
|
location: req.body.location,
|
160
161
|
participants: req.body.participants,
|
161
162
|
lead: createdLead, requester: project_user,
|
162
|
-
priority: req.body.priority
|
163
|
+
priority: req.body.priority,
|
164
|
+
followers: req.body.followers,
|
163
165
|
};
|
164
166
|
|
165
167
|
return requestService.create(new_request).then(function (savedRequest) {
|
@@ -188,7 +190,8 @@ async (req, res) => {
|
|
188
190
|
.populate('lead')
|
189
191
|
.populate('department')
|
190
192
|
.populate('participatingBots')
|
191
|
-
.populate('participatingAgents')
|
193
|
+
.populate('participatingAgents')
|
194
|
+
// .populate('followers')
|
192
195
|
.populate({path:'requester',populate:{path:'id_user'}})
|
193
196
|
.execPopulate(function (err, savedRequestPopulated){
|
194
197
|
|
@@ -247,6 +250,7 @@ async (req, res) => {
|
|
247
250
|
.populate('department')
|
248
251
|
.populate('participatingBots')
|
249
252
|
.populate('participatingAgents')
|
253
|
+
// .populate('followers')
|
250
254
|
.populate({path:'requester',populate:{path:'id_user'}})
|
251
255
|
.execPopulate(function (err, requestPopulated){
|
252
256
|
|
@@ -286,7 +290,6 @@ async (req, res) => {
|
|
286
290
|
|
287
291
|
|
288
292
|
|
289
|
-
|
290
293
|
// router.put('/:messageid', function(req, res) {
|
291
294
|
|
292
295
|
// console.log(req.body);
|