|
|
|
@ -25,7 +25,7 @@ exports.sendText = async ctx => {
|
|
|
|
|
try {
|
|
|
|
|
const sockMsg = wsToSend.sendTextMessage(to, content);
|
|
|
|
|
console.log(JSON.stringify(sockMsg, undefined, 2));
|
|
|
|
|
await upsertOutboundMessage(null, { ...ctx.request.body, id: sockMsg.key });
|
|
|
|
|
await upsertOutboundMessage(null, { ...ctx.request.body, id: sockMsg.key || sockMsg.id });
|
|
|
|
|
return 'Message sent successfully'; // { wsToSend, ret: 'Message sent successfully' };
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error sending message:', error);
|
|
|
|
|