@tiledesk/tiledesk-server 2.3.86 → 2.3.88

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -6,7 +6,10 @@
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
8
 
9
- # 2.3.86 -> PROD v3
9
+ # 2.3.87 -> PROD v3
10
+ - Geo Service fix with queue enabled
11
+
12
+ # 2.3.86
10
13
  - Geo Service fix with queue enabled
11
14
 
12
15
  # 2.3.85
package/models/faq_kb.js CHANGED
@@ -92,7 +92,19 @@ var Faq_kbSchema = new Schema({
92
92
  },
93
93
  tags: [{
94
94
  type: String
95
- }]
95
+ }],
96
+ score: {
97
+ type: Number,
98
+ required: false,
99
+ index: true,
100
+ default: 0
101
+ },
102
+ publishedBy: {
103
+ type: String,
104
+ },
105
+ publishedAt: {
106
+ type: Date
107
+ },
96
108
  },{
97
109
  timestamps: true
98
110
  }
@@ -106,7 +118,7 @@ Faq_kbSchema.virtual('fullName').get(function () {
106
118
  Faq_kbSchema.index({certified: 1, public: 1}); //suggested by atlas
107
119
 
108
120
 
109
- Faq_kbSchema.index({name: 'text', description: 'text', subject: 'text', "tags": 'text'},
121
+ Faq_kbSchema.index({name: 'text', description: 'text', "tags": 'text'},
110
122
  {"name":"faqkb_fulltext","default_language": defaultFullTextLanguage,"language_override": "language"}); // schema level
111
123
 
112
124
 
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.86",
4
+ "version": "2.3.88",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
package/routes/faq_kb.js CHANGED
@@ -236,7 +236,7 @@ router.put('/:faq_kbid/publish', async (req, res) => {
236
236
  winston.debug("forkedChatBotId: "+forkedChatBotId);
237
237
 
238
238
 
239
- let updatedForkedChabot = await Faq_kb.findByIdAndUpdate(forkedChatBotId, {trashed: true}, { new: true, upsert: true }).exec();
239
+ let updatedForkedChabot = await Faq_kb.findByIdAndUpdate(forkedChatBotId, {trashed: true, publishedBy: req.user.id, publishedAt: new Date().getTime()}, { new: true, upsert: true }).exec();
240
240
  winston.debug("updatedForkedChabot: ",updatedForkedChabot);
241
241
  botEvent.emit('faqbot.update', updatedForkedChabot);
242
242
 
@@ -372,7 +372,7 @@ router.delete('/:faq_kbid', function (req, res) {
372
372
 
373
373
  winston.debug(req.body);
374
374
 
375
-
375
+
376
376
  Faq_kb.remove({ _id: req.params.faq_kbid }, function (err, faq_kb) {
377
377
  if (err) {
378
378
  return res.status(500).send({ success: false, msg: 'Error deleting object.' });
@@ -74,9 +74,9 @@ class GeoService {
74
74
  if (geo) {
75
75
  var update = {};
76
76
 
77
- // if (!request.location) {
78
- // request.location = {};
79
- // }
77
+ if (!request.location) {
78
+ request.location = {};
79
+ }
80
80
 
81
81
  if (geo.country && !request.location.country) {
82
82
  winston.debug("geo.country:"+ geo.country);
@@ -98,7 +98,7 @@ class GeoService {
98
98
  if (!request.location.ipAddress) {
99
99
  winston.debug("request.location.ipAddress: " + request.location.ipAddress);
100
100
  // request.location.ipAddress = ip;
101
- update["location.city"] = geo.city;
101
+ update["location.ipAddress"] = ip;
102
102
  }
103
103
 
104
104
  // console.log(request.location.toString());