Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/main/src/app/body/body.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h3 class="dropdown-item-title">
</p>
</a>
</li>
<li class="nav-item" [hidden]="">
<li class="nav-item" [hidden]="loginService.admin">
<a href="" routerLink="dashboard" class="nav-link">
<i class="nav-icon fas fa-chart-bar"></i>
<p>Dashboard</p>
Expand Down
13 changes: 7 additions & 6 deletions frontend/main/src/app/loginservice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { LoginComponent } from './login/login.component';
})
export class LoginserviceService implements CanActivate {

user!: string
readonly TMSLoginAPI: string = "http://localhost:8080"
user!: string
succeed!: boolean
progress: boolean = false
admin:boolean = false
enterprise:boolean = false
progress!: boolean
admin!:boolean
enterprise!:boolean
pessoaID!:number

constructor(private router: Router, private http: HttpClient) { }
Expand All @@ -37,12 +37,13 @@ export class LoginserviceService implements CanActivate {
})
)
.subscribe((response:any)=>{
this.admin = response.admin
this.enterprise = response.enterprise

this.http.get(this.TMSLoginAPI+'/user/'+response[0].pessoa_id)
.subscribe((resp:any) =>{
console.log(resp);
this.user = resp.nome
this.admin = resp.admin
this.enterprise = resp.enterprise
this.pessoaID = response[0].pessoa_id
})
return response
Expand Down