This commit is contained in:
Blandine Bajard 2022-01-21 12:45:59 +01:00
commit 22af2a20ba
33 changed files with 655 additions and 17 deletions

View file

@ -4,6 +4,7 @@ import { Injectable } from '@angular/core';
import { map, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Membre } from '../models/membre';
import { Team } from '../models/team';
@Injectable({
providedIn: 'root',
@ -24,6 +25,7 @@ export class AuthService {
return this.http.post(`${this.apiUrl}/membres/sign-up`, membre);
}
signin(email: string, password: string): Observable<any> {
const body = {
email: email,
@ -58,4 +60,19 @@ export class AuthService {
console.log(password);
return this.http.post(`${this.apiUrl}/membres/reset-password/${email}`, body);
}
creationTeam(team: Team): Observable<any> {
console.log(team);
return this.http.post(`${this.apiUrl}/creation-compte`, team);
}
addMember(membre: Membre): Observable<any> {
console.log(membre);
return this.http.post(`${this.apiUrl}/tableau-de-bord`, membre);
}
}

View file

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { OrganizeeService } from './organizee.service';
describe('OrganizeeService', () => {
let service: OrganizeeService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(OrganizeeService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View file

@ -0,0 +1,18 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root',
})
export class OrganizeeService {
apiUrl: string;
tokenKey: string;
constructor(private http: HttpClient) {
// On se sert des variables d'environnement de notre application
this.apiUrl = environment.apiUrl;
this.tokenKey = environment.tokenKey;
}
}

View file

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { RepertoireService } from './repertoire.service';
describe('RepertoireService', () => {
let service: RepertoireService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(RepertoireService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View file

@ -0,0 +1,28 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Contact } from '../models/contact';
@Injectable({
providedIn: 'root',
})
export class RepertoireService {
apiUrl: string;
tokenKey: string;
constructor(private http: HttpClient) {
// On se sert des variables d'environnement de notre application
this.apiUrl = environment.apiUrl;
this.tokenKey = environment.tokenKey;
}
getContact(): Observable<any> {
return this.http.get(`${this.apiUrl}/contacts/team/1`);
}
//sur le component fiche contact de la page repertoire
// sur clic de btn modifier ou supproimer ca renvois vers page modifier contact
//page modifier contact faire un get by id du contact en question
// appeler methode/ update /delette/ add et contact by id
}