Merge branch 'dev' into cecile
This commit is contained in:
commit
6623310501
51 changed files with 1210 additions and 12704 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { identifierModuleUrl } from '@angular/compiler';
|
||||
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',
|
||||
|
|
@ -20,9 +22,11 @@ export class AuthService {
|
|||
signup(membre: Membre): Observable<any> {
|
||||
console.log(membre);
|
||||
|
||||
return this.http.post(`${this.apiUrl}/membres/signup`, membre);
|
||||
return this.http.post(`${this.apiUrl}/membres/sign-up`, membre);
|
||||
|
||||
}
|
||||
|
||||
|
||||
signin(email: string, password: string): Observable<any> {
|
||||
const body = {
|
||||
email: email,
|
||||
|
|
@ -35,7 +39,7 @@ export class AuthService {
|
|||
// - pour pouvoir stocker dans le localstorage notre accesstoken
|
||||
// - Sous la clé "TOKEN-LBP"
|
||||
|
||||
return this.http.post(`${this.apiUrl}/login`, body).pipe(
|
||||
return this.http.post(`${this.apiUrl}/membres/sign-in`, body).pipe(
|
||||
map((x: any) => {
|
||||
console.log('Service : ', x.accessToken);
|
||||
// Modification à faire ici
|
||||
|
|
@ -45,14 +49,31 @@ export class AuthService {
|
|||
);
|
||||
}
|
||||
|
||||
forgotPassword(email: string, password: string): Observable<any> {
|
||||
forgotPassword(email: string): Observable<any> {
|
||||
const body = {
|
||||
email: email,
|
||||
password: password,
|
||||
};
|
||||
|
||||
console.log('Mon body : ', body);
|
||||
|
||||
return this.http.post(`${this.apiUrl}/forgot-psw`, body);
|
||||
return this.http.post(`${this.apiUrl}/membres/forgot-password`, body);
|
||||
}
|
||||
|
||||
resetPassword(email: string, password: string): Observable<any> {
|
||||
const body = password;
|
||||
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}/teams/add`, team);
|
||||
}
|
||||
|
||||
|
||||
|
||||
addMember(membre: Membre): Observable<any> {
|
||||
console.log(membre);
|
||||
|
||||
return this.http.post(`${this.apiUrl}/tableau-de-bord`, membre);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
16
src/app/services/organizee.service.spec.ts
Normal file
16
src/app/services/organizee.service.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
18
src/app/services/organizee.service.ts
Normal file
18
src/app/services/organizee.service.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
16
src/app/services/repertoire.service.spec.ts
Normal file
16
src/app/services/repertoire.service.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
37
src/app/services/repertoire.service.ts
Normal file
37
src/app/services/repertoire.service.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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`);
|
||||
}
|
||||
|
||||
addContact(contact: Contact): Observable<any> {
|
||||
console.log(contact);
|
||||
|
||||
return this.http.post(`${this.apiUrl}/contacts/add`, contact);
|
||||
}
|
||||
|
||||
deleteContact() {
|
||||
return this.http.delete(`${this.apiUrl}/contacts/delete`);
|
||||
}
|
||||
|
||||
// updateContact(){
|
||||
// return this.http.put(`${this.apiUrl}/contacts/update/1`);
|
||||
// }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue