@runnerpro/backend 1.5.4 → 1.5.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.
|
@@ -75,6 +75,13 @@ const getConversation = (req, res, { query, isClient }) => __awaiter(void 0, voi
|
|
|
75
75
|
return message;
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
else {
|
|
79
|
+
messages = messages.map((message) => {
|
|
80
|
+
if (message.replyMessageId)
|
|
81
|
+
message.reply = messages.find((m) => m.id === message.replyMessageId);
|
|
82
|
+
return message;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
78
85
|
res.send({ header, messages });
|
|
79
86
|
// Solo se marca como leído si es el cliente | El entrenador tiene el botón o enviar mensaje para marcar como leído
|
|
80
87
|
if (isClient)
|
|
@@ -251,7 +258,7 @@ const readMessage = (req, res, { query, isClient }) => __awaiter(void 0, void 0,
|
|
|
251
258
|
res.send({ status: 'ok' });
|
|
252
259
|
});
|
|
253
260
|
const markReadMessage = ({ isClient, query, idCliente }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
254
|
-
const conditionSender = isClient ? ' AND [ID SENDER] != ?' : ' AND ([ID SENDER] = ?
|
|
261
|
+
const conditionSender = isClient ? ' AND [ID SENDER] != ?' : ' AND ([ID SENDER] = ? OR [ID SENDER] IS NULL)';
|
|
255
262
|
yield query('UPDATE [CHAT MESSAGE] SET [READ] = TRUE WHERE [ID CLIENTE] = ? AND [READ] = FALSE ' + conditionSender, [idCliente, idCliente]);
|
|
256
263
|
yield saveResponseTime({ query, isClient, idCliente });
|
|
257
264
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAmBpD,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAmBpD,CAAC;AAiTF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|