mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
add error message
This commit is contained in:
@@ -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