mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
delete room
This commit is contained in:
@@ -101,6 +101,19 @@ export class RoomRepositoryService {
|
||||
return result
|
||||
}
|
||||
|
||||
@captureAndReraiseAsync('RoomRepositoryService/deleteRoomById')
|
||||
async deleteRoomById(id: RoomByIdInputDTO) {
|
||||
const result = await this.roomRemoteDataSourceService.deleteRoom(id)
|
||||
|
||||
if(result.isOk()) {
|
||||
|
||||
return await this.roomLocalDataSourceService.deleteRoomById(id)
|
||||
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@captureAndReraiseAsync('RoomRepositoryService/create')
|
||||
async create(data: RoomInputDTO) {
|
||||
|
||||
|
||||
@@ -110,11 +110,26 @@ export class ChatPopoverPage implements OnInit {
|
||||
}
|
||||
|
||||
//Delete
|
||||
deleteGroup() {
|
||||
let body = { "roomId":this.roomId }
|
||||
async deleteGroup() {
|
||||
this.showLoader = true
|
||||
const result = await this.RoomRepositoryService.deleteRoomById(this.roomId)
|
||||
|
||||
|
||||
this.close('delete');
|
||||
if(result.isOk()) {
|
||||
this.close('delete');
|
||||
// this.openGroupMessage.emit(this.roomId);
|
||||
} else if (result.error instanceof HttpResponse) {
|
||||
// this.httpErrorHandle.httpStatusHandle(result.error)
|
||||
} else if (result.error instanceof ZodError) {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error.errors)
|
||||
} else {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error)
|
||||
}
|
||||
|
||||
this.showLoader = false
|
||||
|
||||
}
|
||||
|
||||
async openChangeGroupName(){
|
||||
|
||||
Reference in New Issue
Block a user