@runnerpro/backend 1.12.16 → 1.12.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -217,7 +217,7 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
217
217
  const { text, replyMessageId, new: newMessage } = req.body;
218
218
  const { userid } = req.session;
219
219
  const idCliente = isClient ? req.session.userid : req.body.idCliente;
220
- let idWorkout;
220
+ let idWorkout, type = 1;
221
221
  // Si es entrenador, se marca leído cuando se envía un mensaje
222
222
  if (!isClient)
223
223
  yield markReadMessage({ isClient, idCliente });
@@ -230,9 +230,10 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
230
230
  console.log(req.body);
231
231
  // Enviado cuando es un mensaje de comentario sobre intelligence
232
232
  if (newMessage) {
233
- console.log('es new Message');
233
+ type = 6;
234
+ idWorkout = newMessage.idWorkout;
234
235
  }
235
- const [message] = yield (0, index_1.query)('INSERT INTO [CHAT MESSAGE] ([ID CLIENTE], [ID SENDER], [TEXT], [TEXT PREFERRED LANGUAGE], [PREFERRED LANGUAGE], [REPLY MESSAGE ID], [TYPE]) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING [ID]', [isClient ? userid : idCliente, userid, textSpanish, textPreferredLanguage, preferredLanguage, replyMessageId, 1]);
236
+ const [message] = yield (0, index_1.query)('INSERT INTO [CHAT MESSAGE] ([ID CLIENTE], [ID SENDER], [TEXT], [TEXT PREFERRED LANGUAGE], [PREFERRED LANGUAGE], [REPLY MESSAGE ID], [ID WORKOUT], [TYPE]) VALUES (?, ?, ?, ?, ?, ?, ?, ?) RETURNING [ID]', [isClient ? userid : idCliente, userid, textSpanish, textPreferredLanguage, preferredLanguage, replyMessageId, idWorkout, type]);
236
237
  res.send({ idMessage: message.id });
237
238
  if (!isClient) {
238
239
  sendNotification({
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAmZF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAqZF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.12.16",
3
+ "version": "1.12.17",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"