mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add error message
This commit is contained in:
@@ -102,15 +102,15 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async openNewGroupPage() {
|
||||
let roomName = this.loadedEvent.Subject
|
||||
let attendees = this.loadedEvent.Attendees
|
||||
// async openNewGroupPage() {
|
||||
// let roomName = this.loadedEvent.Subject
|
||||
// let attendees = this.loadedEvent.Attendees
|
||||
|
||||
const room = await EventController.createOrFindGroupFromEvent(roomName, attendees)
|
||||
// const room = await EventController.createOrFindGroupFromEvent(roomName, attendees)
|
||||
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "roomId": room.id } };
|
||||
this.router.navigate(['/home/chat'], navigationExtras);
|
||||
}
|
||||
// let navigationExtras: NavigationExtras = { queryParams: { "roomId": room.id } };
|
||||
// this.router.navigate(['/home/chat'], navigationExtras);
|
||||
// }
|
||||
|
||||
close() {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn-no-color adicionar" (click)="updateGroup()">
|
||||
<ion-label>Adicionar</ion-label>
|
||||
<ion-label>Adicionar bug</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpRequest } from '@angular/common/http';
|
||||
import { ZodError } from 'zod';
|
||||
import { HttpResponse } from '@microsoft/signalr';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-contacts',
|
||||
@@ -22,6 +23,8 @@ export class GroupContactsPage implements OnInit {
|
||||
|
||||
@Input() roomId:string;
|
||||
@Output() openGroupMessage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openGroupContacts:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
|
||||
currentMembers:UserContacts[];
|
||||
allChatUsers: UserContacts[] = [];
|
||||
@@ -99,10 +102,12 @@ export class GroupContactsPage implements OnInit {
|
||||
}))
|
||||
|
||||
}
|
||||
else if (getRoomById.isErr()) {
|
||||
else if (getRoomById.isErr() && getRoomById.error instanceof HttpResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(getRoomById.error)
|
||||
} else if (getallChatUsers.isErr()) {
|
||||
} else if (getallChatUsers.isErr() && getallChatUsers.error instanceof HttpResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(getallChatUsers.error)
|
||||
} else {
|
||||
alert('else')
|
||||
}
|
||||
|
||||
const currentMemberIds = this.currentMembers.map(e => e.wxUserId)
|
||||
|
||||
@@ -31,19 +31,19 @@
|
||||
<div class="main-content">
|
||||
<ion-progress-bar class="position-absolute" type="indeterminate" *ngIf="loading"></ion-progress-bar>
|
||||
<ion-virtual-scroll [items]="userList" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{ header }}</ion-label>
|
||||
</div>
|
||||
|
||||
|
||||
<div (click)="openMessagesPage(user.wxFullName)" *virtualItem="let user" class="item-user cursor-pointer">
|
||||
<p>{{ user.wxFullName }}</p>
|
||||
<span class="icon">
|
||||
<ion-icon [class]="user.status" slot="end" name="ellipse"></ion-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-virtual-scroll>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -4,11 +4,12 @@ import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { RoomRepositoryService } from 'src/app/services/Repositorys/chat/repository/room-repository.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-group',
|
||||
templateUrl: './new-group.page.html',
|
||||
@@ -49,7 +50,8 @@ export class NewGroupPage implements OnInit{
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private roomRepositoryService: RoomRepositoryService
|
||||
private roomRepositoryService: RoomRepositoryService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
)
|
||||
{
|
||||
this.loggedUserChat = SessionStore.user.ChatData['data'];
|
||||
@@ -121,13 +123,15 @@ export class NewGroupPage implements OnInit{
|
||||
roomName: this.groupName,
|
||||
createdBy: SessionStore.user.UserId,
|
||||
roomType: 0,
|
||||
expirationDate: null
|
||||
expirationDate: null,
|
||||
members: []
|
||||
|
||||
})
|
||||
|
||||
if(result.isOk()) {
|
||||
// this.addGroupMessage.emit(result);
|
||||
this.addGroupMessage.emit(result.value.data.id);
|
||||
} else if(result.error instanceof HttpErrorResponse) {
|
||||
|
||||
this.httpErrorHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user