mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
fix chat
This commit is contained in:
@@ -37,34 +37,28 @@ export class MessageCreateUseCaseService {
|
||||
const createMessageLocally = await this.MessageRepositoryService.createMessageLocally(message)
|
||||
|
||||
if(createMessageLocally.isOk()) {
|
||||
|
||||
|
||||
console.log('==========================',message);
|
||||
if(message.hasAttachment) {
|
||||
|
||||
|
||||
for (const attachment of message.attachments) {
|
||||
|
||||
|
||||
const createAttachmentLocally = this.AttachmentRepositoryService.create({
|
||||
$messageId: createMessageLocally.value.$id,
|
||||
file: createDataURL(attachment.file, attachment.mimeType)
|
||||
file: createDataURL(attachment.file, attachment.mimeType)
|
||||
})
|
||||
|
||||
attachment.safeFile = createDataURL(attachment.file, attachment.mimeType)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const sendToServer = await this.MessageRepositoryService.sendMessage(message)
|
||||
|
||||
|
||||
// if(sendToServer.isOk()) {
|
||||
// for (const attachment of message.attachments) {
|
||||
|
||||
// const attachment = await this.AttachmentRepositoryService.findOne({
|
||||
// $messageId: createMessageLocally.value.$id
|
||||
// })
|
||||
// }
|
||||
|
||||
// }
|
||||
if(!sendToServer.isOk()) {
|
||||
console.log('sendToServer error', sendToServer.error)
|
||||
}
|
||||
|
||||
|
||||
return sendToServer
|
||||
|
||||
Reference in New Issue
Block a user