@runnerpro/backend 1.12.16 → 1.12.18

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.
@@ -65,7 +65,7 @@ const getConversation = (req, res, { isClient }) => __awaiter(void 0, void 0, vo
65
65
  const [header] = yield (0, index_1.query)('SELECT [NAME], [PREFERRED LANGUAGE] FROM [CLIENTE] WHERE [ID] = ?', [idCliente]);
66
66
  let messages = yield (0, index_1.query)(`SELECT [CHAT MESSAGE].*,
67
67
  [WORKOUT].[DATE] AS [WORKOUT DATE], [WORKOUT].[TYPE] AS [WORKOUT TYPE], [WORKOUT].[TITLE] AS [WORKOUT TITLE], [WORKOUT].[TITLE PREFERRED LANGUAGE] AS [WORKOUT TITLE],
68
- [WORKOUT].[DURATION] AS [WORKOUT DURATION], [WORKOUT].[DISTANCE] AS [WORKOUT DISTANCE],
68
+ [WORKOUT].[DURATION] AS [WORKOUT DURATION], [WORKOUT].[DISTANCE] AS [WORKOUT DISTANCE], [WORKOUT].[RESUMEN] AS [WORKOUT RESUMEN],
69
69
  [WORKOUT].[PHOTO URL SHARE] AS [WORKOUT PHOTO URL SHARE], [WORKOUT].[PHOTO URL] AS [WORKOUT PHOTO URL], [FEELINGS], [FEELINGS DESCRIPTION]
70
70
  FROM [CHAT MESSAGE]
71
71
  LEFT JOIN [WORKOUT] ON [WORKOUT].[ID] = [CHAT MESSAGE].[ID WORKOUT]
@@ -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.18",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"