mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
validate user permision on chat
This commit is contained in:
@@ -11,6 +11,7 @@ import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service'
|
||||
import { UDate } from 'src/app/utils/date';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-group',
|
||||
@@ -53,7 +54,8 @@ export class NewGroupPage implements OnInit{
|
||||
private RouteService: RouteService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private ChatServiceService: ChatServiceService
|
||||
private ChatServiceService: ChatServiceService,
|
||||
private toastService: ToastService,
|
||||
)
|
||||
{
|
||||
this.loggedUserChat = SessionStore.user.ChatData['data'];
|
||||
@@ -130,9 +132,11 @@ export class NewGroupPage implements OnInit{
|
||||
})
|
||||
|
||||
if(result.isOk()) {
|
||||
this.addGroupMessage.emit(result.value.data.id);
|
||||
this.addGroupMessage.emit(result.value.id);
|
||||
} else if(result.error instanceof HttpErrorResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(result.error)
|
||||
} else {
|
||||
this.toastService._badRequest('Por favor, contacta um administrador.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user