mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add endpoint
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Injectable, Input } from '@angular/core';
|
||||
import { MessageLocalDataSourceService } from '../../../data/data-source/message/message-local-data-source.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SocketMessageCreateUseCaseService {
|
||||
|
||||
constructor(
|
||||
private messageLocalDataSourceService: MessageLocalDataSourceService,
|
||||
) { }
|
||||
|
||||
async execute(input: any) {
|
||||
|
||||
const id = input.id + ''
|
||||
delete input.id;
|
||||
|
||||
const incomingMessage = {
|
||||
...input,
|
||||
messageId: id,
|
||||
sending: false,
|
||||
roomId:input.chatRoomId
|
||||
}
|
||||
|
||||
const result = await this.messageLocalDataSourceService.sendMessage(incomingMessage)
|
||||
|
||||
if(result.isOk()) {
|
||||
|
||||
} else {
|
||||
console.log(result.error)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user