add metods to update room name

This commit is contained in:
Peter Maquiran
2024-06-11 13:48:44 +01:00
parent 4c1ad6d648
commit 540cbbc911
7 changed files with 44 additions and 14 deletions
@@ -12,7 +12,7 @@
<div class="middle">
<ion-label class="title">Alterar assunto</ion-label>
</div>
<app-btn-seguinte *ngIf="groupName" (click)="changeGroupName()"></app-btn-seguinte>
<app-btn-seguinte (click)="changeGroupName()"></app-btn-seguinte>..1
</div>
</div>
</ion-toolbar>
@@ -38,7 +38,7 @@
</div>
</div>
</div>
</div>
</div>
</ion-content>
@@ -40,24 +40,24 @@ export class EditGroupPage implements OnInit {
getRoomInfo(){
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
try {
this.groupName = this.room.name.split('-').join(' ');
} catch (error) {
this.groupName = this.room.name;
}
});
}
close(){
close() {
//this.modalController.dismiss();
this.closeAllDesktopComponents.emit();
this.openGroupMessage.emit(this.roomId);
}
changeGroupName(){
if(this.groupName.trim().length > 1){
changeGroupName() {
if(this.groupName.trim().length > 1) {
let name = this.groupName.split(' ').join('-');
let body = {
"roomId": this.room._id,
@@ -68,7 +68,7 @@ export class EditGroupPage implements OnInit {
});
}
else{
}
this.updateGroup();
}
@@ -96,13 +96,13 @@ export class EditGroupPage implements OnInit {
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
this.selectedDuration = [
value.days.value,
value.hours.value,
value.minutes.value,
]
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){