@runnerpro/backend 1.12.14 → 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.
|
@@ -189,7 +189,6 @@ const getConversationFile = (req, res, { bucket, isClient }) => __awaiter(void 0
|
|
|
189
189
|
});
|
|
190
190
|
if (!result)
|
|
191
191
|
return res.status(404).send('Not found');
|
|
192
|
-
console.log(result);
|
|
193
192
|
res.writeHead(200, {
|
|
194
193
|
'Content-Type': result.message.text,
|
|
195
194
|
'Content-disposition': 'inline',
|
|
@@ -204,7 +203,6 @@ const getChatFile = ({ bucket, id, isClient, userid }) => __awaiter(void 0, void
|
|
|
204
203
|
isClient,
|
|
205
204
|
userid,
|
|
206
205
|
]);
|
|
207
|
-
console.log({ message });
|
|
208
206
|
if (!message)
|
|
209
207
|
return null;
|
|
210
208
|
try {
|
|
@@ -216,9 +214,10 @@ const getChatFile = ({ bucket, id, isClient, userid }) => __awaiter(void 0, void
|
|
|
216
214
|
}
|
|
217
215
|
});
|
|
218
216
|
const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
219
|
-
const { text, replyMessageId } = req.body;
|
|
217
|
+
const { text, replyMessageId, new: newMessage } = req.body;
|
|
220
218
|
const { userid } = req.session;
|
|
221
219
|
const idCliente = isClient ? req.session.userid : req.body.idCliente;
|
|
220
|
+
let idWorkout, type = 1;
|
|
222
221
|
// Si es entrenador, se marca leído cuando se envía un mensaje
|
|
223
222
|
if (!isClient)
|
|
224
223
|
yield markReadMessage({ isClient, idCliente });
|
|
@@ -228,7 +227,13 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
|
|
|
228
227
|
idCliente,
|
|
229
228
|
isClient,
|
|
230
229
|
});
|
|
231
|
-
|
|
230
|
+
console.log(req.body);
|
|
231
|
+
// Enviado cuando es un mensaje de comentario sobre intelligence
|
|
232
|
+
if (newMessage) {
|
|
233
|
+
type = 6;
|
|
234
|
+
idWorkout = newMessage.idWorkout;
|
|
235
|
+
}
|
|
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]);
|
|
232
237
|
res.send({ idMessage: message.id });
|
|
233
238
|
if (!isClient) {
|
|
234
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;
|
|
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"}
|