mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import { EventPerson } from '../models/eventperson.model';
|
||
|
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||
|
|
import { Observable } from 'rxjs';
|
||
|
|
import { environment } from 'src/environments/environment';
|
||
|
|
import { AuthService } from '../services/auth.service';
|
||
|
|
import { User } from '../models/user.model';
|
||
|
|
import { OrganicEntity } from 'src/app/models/organic-entity.model';
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class OrganicEntityService {
|
||
|
|
|
||
|
|
authheader = {};
|
||
|
|
loggeduser: User;
|
||
|
|
headers: HttpHeaders;
|
||
|
|
|
||
|
|
constructor(private http: HttpClient, user: AuthService) {
|
||
|
|
this.loggeduser = user.ValidatedUser;
|
||
|
|
this.headers = new HttpHeaders();
|
||
|
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||
|
|
}
|
||
|
|
|
||
|
|
getOrganicEntity(): Observable<OrganicEntity[]>{
|
||
|
|
|
||
|
|
const geturl = environment.apiURL + 'ecm/organic';
|
||
|
|
|
||
|
|
let options = {
|
||
|
|
headers: this.headers,
|
||
|
|
};
|
||
|
|
|
||
|
|
return this.http.get<OrganicEntity[]>(`${geturl}`, options);
|
||
|
|
}
|
||
|
|
}
|