mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add interface
This commit is contained in:
+25
-2
@@ -1,6 +1,29 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MessageLocalDataSourceService } from '../../../data/repository/message/message-local-data-source.service';
|
||||
import { MessageOutPutDataDTO } from '../../../data/dto/message/messageOutputDTO';
|
||||
import { MessageEntitySchema } from 'src/app/core/chat/entity/message';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SocketMessageDeleteOutputSchema = MessageEntitySchema.pick({
|
||||
id: true,
|
||||
attachments: true,
|
||||
canEdit: true,
|
||||
editedAt: true,
|
||||
info: true,
|
||||
isDeleted: true,
|
||||
message: true,
|
||||
messageType: true,
|
||||
oneShot: true,
|
||||
reactions: true,
|
||||
receiverId: true,
|
||||
requireUnlock: true,
|
||||
roomId: true,
|
||||
sender: true,
|
||||
sending: true,
|
||||
sentAt: true,
|
||||
})
|
||||
|
||||
|
||||
export type ISocketMessageDeleteOutput = z.infer<typeof SocketMessageDeleteOutputSchema>
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -12,7 +35,7 @@ export class SocketMessageDeleteUseCaseService {
|
||||
) { }
|
||||
|
||||
|
||||
async execute(input: MessageOutPutDataDTO) {
|
||||
async execute(input: ISocketMessageDeleteOutput) {
|
||||
const result = await this.messageLocalDataSourceService.update(input.id, { isDeleted: true})
|
||||
|
||||
if(result.isOk()) {
|
||||
|
||||
Reference in New Issue
Block a user