mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
remove method to infra added to message repository
This commit is contained in:
+17
-6
@@ -1,6 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { err, ok } from 'neverthrow';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { MessageDeleteInputDTO } from '../../dto/message/messageDeleteInputDTO';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { InstanceId } from '../../../domain/chat-service.service';
|
||||
@@ -9,6 +7,8 @@ import { MessageOutPutDataDTO } from '../../dto/message/messageOutputDTO';
|
||||
import { MessageInputDTO } from '../../dto/message/messageInputDtO';
|
||||
import { MessageReactionInput } from '../../../domain/use-case/message/message-reaction-by-id-use-case.service';
|
||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
||||
|
||||
interface msgObj {
|
||||
roomId: string;
|
||||
@@ -109,17 +109,28 @@ export class MessageSocketRepositoryService {
|
||||
}
|
||||
|
||||
listenToMessages() {
|
||||
return this.socket.getMessage()
|
||||
return this.socket.getData().pipe(
|
||||
filter((e) : e is SocketMessage<MessageOutPutDataDTO>=> e?.method == 'ReceiveMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
listenToDeleteMessages() {
|
||||
return this.socket.getMessageDelete()
|
||||
return this.socket.getData().pipe(
|
||||
filter((e) : e is SocketMessage<MessageOutPutDataDTO>=> e?.method == 'DeleteMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
listenToUpdateMessages() {
|
||||
return this.socket.getMessageUpdate()
|
||||
return this.socket.getData().pipe(
|
||||
filter((e) : e is SocketMessage<MessageOutPutDataDTO>=> e?.method == 'UpdateMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user