reorganizde file path

This commit is contained in:
Peter Maquiran
2024-08-27 09:14:59 +01:00
parent 98975856c1
commit e80082f9e8
54 changed files with 236 additions and 454 deletions
@@ -0,0 +1,39 @@
import { Injectable } from '@angular/core';
import { captureAndReraiseAsync } from 'src/app/services/decorators/captureAndReraiseAsync';
import { RoomUpdateInputDTO } from '../../../data/dto/room/roomUpdateInputDTO';
import { RoomRemoteDataSourceService } from '../../../data/repository/room/room-remote-repository.service';
import { RoomLocalRepository } from '../../../data/repository/room/room-local-repository.service';
@Injectable({
providedIn: 'root'
})
export class UpdateRoomByIdUseCaseService {
constructor(
private roomRemoteDataSourceService: RoomRemoteDataSourceService,
private roomLocalDataSourceService: RoomLocalRepository,
) { }
@captureAndReraiseAsync('RoomRepositoryService/updateRoomBy')
async execute(data: RoomUpdateInputDTO) {
const result = await this.roomRemoteDataSourceService.updateRoom(data)
if(result.isOk()) {
const localList = await this.roomLocalDataSourceService.findAll()
// const { roomsToDelete, roomsToInsert, roomsToUpdate } = roomListDetermineChanges([result.value.data], localList)
// for( const roomData of roomsToUpdate) {
// if(!roomData.chatRoom.createdBy?.wxUserId) {
// delete roomData.chatRoom.createdBy;
// }
// this.roomLocalDataSourceService.updateRoom(roomData.chatRoom)
// }
}
return result
}
}