mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Attendees Enhancments
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ContactsService } from './contacts.service';
|
||||
|
||||
describe('ContactsService', () => {
|
||||
let service: ContactsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ContactsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
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';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContactsService {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
getContacts(namefilter:string): Observable<EventPerson[]>{
|
||||
const geturl = environment.apiURL + 'contacts/get';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("namefilter", namefilter);
|
||||
params = params.set("domain", environment.domain);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<EventPerson[]>(`${geturl}`, options);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export class EventsService {
|
||||
authheader = {};
|
||||
loggeduser: User;
|
||||
headers: HttpHeaders;
|
||||
lastloadedevent: Event;
|
||||
//lastloadedevent: Event;
|
||||
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
this.loggeduser = user.ValidatedUser;
|
||||
|
||||
Reference in New Issue
Block a user