Skip to content
Snippets Groups Projects
Commit 6ce6f181 authored by Dante Aléo's avatar Dante Aléo :pouting_cat:
Browse files

Merge branch...

Merge branch '99-adicionar-mensagens-de-erro-quando-usuario-tentar-cadastrar-hospital-sem-estar-logado' into 'development'

Resolve "Adicionar mensagens de erro quando usuario tentar cadastrar hospital sem estar logado"

Closes #99

See merge request !113
parents a7230d2b 8ab3374d
No related branches found
No related tags found
1 merge request!113Resolve "Adicionar mensagens de erro quando usuario tentar cadastrar hospital sem estar logado"
<section class="register-page" lang="pt">
<p *ngIf="!_authService.loggedIn()" style="text-align:center; font-size:25px;"><b>Para cadastrar um hospital, você deve estar <a routerLink="/login">logado</a></b></p>
<div class="register-card col-md-6 mx-auto">
<h2>Dados do hospital:</h2>
......
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { HospitalService } from '../hospital.service';
import { Router } from '@angular/router';
import { Hospital } from '../hospital';
import { AuthService } from '../auth.service';
@Component({
selector: 'app-register-hospital',
......@@ -20,7 +21,8 @@ export class RegisterHospitalComponent implements OnInit {
}
constructor(private hospitalService: HospitalService,
private _router: Router) { }
private _router: Router,
public _authService: AuthService) { }
ngOnInit() {
}
......@@ -31,7 +33,7 @@ export class RegisterHospitalComponent implements OnInit {
}
}
private valid() {
private async valid() {
var v = true
......@@ -69,6 +71,10 @@ export class RegisterHospitalComponent implements OnInit {
else { console.log("selected_file not found") }
}
if (await !this._authService.loggedIn()) {
window.alert("Cadastro não autorizado\nPor favor logue e tente novamente")
}
return v
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment