mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix
This commit is contained in:
@@ -6,6 +6,7 @@ import { environment } from 'src/environments/environment';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { LoginUserRespose, UserSession } from '../models/user.model';
|
||||
import { EventList } from '../models/agenda/AgendaEventList';
|
||||
import { ChangeProfileService } from './change-profile.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@@ -27,8 +28,13 @@ export class EventsService {
|
||||
headersSharedPessoal: HttpHeaders;
|
||||
//lastloadedevent: Event;
|
||||
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
this.loggeduser = user.ValidatedUser;
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
public user: AuthService,
|
||||
private changeProfileService: ChangeProfileService)
|
||||
{
|
||||
|
||||
this.loggeduser = this.user.ValidatedUser;
|
||||
|
||||
this.headersMdOficial = new HttpHeaders();
|
||||
this.headersMdPessoal = new HttpHeaders();
|
||||
@@ -39,6 +45,17 @@ export class EventsService {
|
||||
this.headersSharedOficial = new HttpHeaders();
|
||||
this.headersSharedPessoal = new HttpHeaders();
|
||||
|
||||
|
||||
this.setHeader()
|
||||
this.changeProfileService.registerCallback(()=>{
|
||||
this.loggeduser = this.user.ValidatedUser;
|
||||
this.setHeader()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
setHeader() {
|
||||
|
||||
if(this.loggeduser){
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
@@ -89,8 +106,6 @@ export class EventsService {
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* getAllEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
|
||||
Reference in New Issue
Block a user