@runnerpro/backend 1.15.4 → 1.15.6

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.
@@ -73,7 +73,8 @@ const getConversation = (req, res, { isClient }) => __awaiter(void 0, void 0, vo
73
73
  FROM "CHAT MESSAGE"
74
74
  LEFT JOIN "WORKOUT" ON "WORKOUT"."ID" = "CHAT MESSAGE"."ID WORKOUT"
75
75
  LEFT JOIN "CLIENTE" ON "CLIENTE"."ID" = "CHAT MESSAGE"."ID CLIENTE"
76
- LEFT JOIN "ENTRENADOR" ON "ENTRENADOR"."ID" = COALESCE("CHAT MESSAGE"."ID SENDER VIEW", "CLIENTE"."ID ENTRENADOR PRINCIPAL")
76
+ LEFT JOIN "ENTRENADOR" ON "ENTRENADOR"."ID" = COALESCE("CHAT MESSAGE"."ID SENDER VIEW", "CLIENTE"."ID ENTRENADOR PRINCIPAL")
77
+ AND "CHAT MESSAGE"."ID CLIENTE" != "CHAT MESSAGE"."ID SENDER"
77
78
  WHERE "CHAT MESSAGE"."ID CLIENTE" = ? AND (${isClient} = FALSE OR "CHAT MESSAGE"."SHOW CLIENT" = TRUE)
78
79
  ORDER BY "CHAT MESSAGE"."DATE" DESC
79
80
  LIMIT 100`, [idCliente]);
@@ -269,7 +270,7 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
269
270
  firebaseMessaging,
270
271
  idCliente,
271
272
  title: '💬 Nuevo mensaje de tu entrenador',
272
- body: `Rubén: ${textPreferredLanguage || textSpanish}`,
273
+ body: textPreferredLanguage || textSpanish,
273
274
  screen: common_1.NOTIFICATION_SCREEN_TYPES.CHAT,
274
275
  });
275
276
  // Enviar a N8N lo que ha escrito el entrenador
@@ -283,8 +284,8 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
283
284
  // msg: textSpanish,
284
285
  // });
285
286
  // }
287
+ yield updateSenderView({ userid, idCliente, idMessage: message.id });
286
288
  }
287
- yield updateSenderView({ userid, idCliente, idMessage: message.id });
288
289
  });
289
290
  const updateSenderView = ({ userid, idCliente, idMessage }) => __awaiter(void 0, void 0, void 0, function* () {
290
291
  const [cliente] = yield (0, index_1.query)('SELECT [ID ENTRENADOR PRINCIPAL], [ID ENTRENADOR SECUNDARIO] FROM [CLIENTE] WHERE [ID] = ?', [idCliente]);
@@ -395,7 +396,7 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
395
396
  firebaseMessaging,
396
397
  idCliente,
397
398
  title: (0, index_2.t)('💬 Nuevo mensaje de tu entrenador', cliente.preferredLanguage),
398
- body: `Rubén: ${(0, index_2.t)(textFile, cliente.preferredLanguage)}`,
399
+ body: (0, index_2.t)(textFile, cliente.preferredLanguage),
399
400
  screen: common_1.NOTIFICATION_SCREEN_TYPES.CHAT,
400
401
  });
401
402
  yield updateSenderView({ userid, idCliente, idMessage: idFile });
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AA4PF,QAAA,MAAM,gBAAgB;;;;mBAQrB,CAAC;AAsRF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AA6PF,QAAA,MAAM,gBAAgB;;;;mBAQrB,CAAC;AAsRF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.15.4",
3
+ "version": "1.15.6",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"