Merge branch 'dev' of https://github.com/AlineRinquin/organizee-front into blandine
This commit is contained in:
commit
6c489a4fda
29 changed files with 581 additions and 212 deletions
|
|
@ -44,17 +44,13 @@ export class AuthService {
|
|||
|
||||
}
|
||||
|
||||
forgotPassword(email: string): Observable<any> {
|
||||
const body = {
|
||||
email: email,
|
||||
};
|
||||
return this.http.get(`${this.apiUrl}/membres/forgot-password`);
|
||||
forgotPassword(membre: Membre): Observable<any> {
|
||||
return this.http.post(`${this.apiUrl}/membres/forgot-password`, membre, {responseType: "text"});
|
||||
}
|
||||
|
||||
resetPassword(email: string, password: string): Observable<any> {
|
||||
const body = password;
|
||||
console.log(password);
|
||||
return this.http.put(`${this.apiUrl}/membres/reset-password/${email}`, body);
|
||||
resetPassword(membre: Membre, uuid:string): Observable<any> {
|
||||
console.log('--'+uuid+' / '+membre);
|
||||
return this.http.put(`${this.apiUrl}/membres/reset-password/${uuid}`, membre);
|
||||
}
|
||||
|
||||
creationTeam(team: Team): Observable<any> {
|
||||
|
|
|
|||
16
src/app/services/mail.service.spec.ts
Normal file
16
src/app/services/mail.service.spec.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MailService } from './mail.service';
|
||||
|
||||
describe('MailService', () => {
|
||||
let service: MailService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(MailService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
29
src/app/services/mail.service.ts
Normal file
29
src/app/services/mail.service.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Mail } from '../models/mail';
|
||||
import { TokenService } from './token.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MailService {
|
||||
apiUrl: string;
|
||||
tokenKey: string;
|
||||
|
||||
constructor(private http: HttpClient, private tokenService: TokenService, private router: Router) {
|
||||
this.apiUrl = environment.apiUrl;
|
||||
this.tokenKey = environment.tokenKey;
|
||||
}
|
||||
|
||||
envoiMailText(mail: Mail): Observable<any> | void{
|
||||
return this.http.post(`${this.apiUrl}/sendmail/text`, mail, {
|
||||
responseType: "text"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ import { Observable } from 'rxjs';
|
|||
import { environment } from 'src/environments/environment';
|
||||
import { Tache } from '../models/tache';
|
||||
import { ToDoList } from '../models/to-do-list';
|
||||
import { TodoList } from '../todo-list';
|
||||
import { TokenService } from './token.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
|
@ -12,12 +14,13 @@ export class TodoService {
|
|||
private toDoList: any;
|
||||
private apiUrl: string;
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
constructor(private http: HttpClient, private tokenService: TokenService) {
|
||||
this.apiUrl = environment.apiUrl;
|
||||
}
|
||||
|
||||
getToDoListByTeamId(): Observable<any> {
|
||||
return this.http.get(`${this.apiUrl}/todolist/team/1`);
|
||||
getToDoListByTeamId(): Observable<any> | void {
|
||||
const teamId = this.tokenService.getCurrentTeamId();
|
||||
return this.http.get(`${this.apiUrl}/todolist/team/${teamId}`);
|
||||
}
|
||||
|
||||
deleteTacheById(idTache: any): Observable<any> {
|
||||
|
|
@ -27,12 +30,27 @@ export class TodoService {
|
|||
}
|
||||
|
||||
addTache(newtache: Tache, idTodoList: number): Observable<any> {
|
||||
// console.log(newtache);
|
||||
// console.log(newtache);
|
||||
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
||||
}
|
||||
|
||||
updateTache(tache: Tache): Observable<any> {
|
||||
console.log(tache);
|
||||
console.log(tache);
|
||||
return this.http.put(`${this.apiUrl}/taches/update/1`, tache);
|
||||
}
|
||||
addTodoByTeamId(newtodoList: TodoList): Observable<any> {
|
||||
const teamId = this.tokenService.getCurrentTeamId();
|
||||
console.log(newtodoList + 'newtodoList');
|
||||
return this.http.post(`${this.apiUrl}/todolist/add/${teamId}`, newtodoList);
|
||||
}
|
||||
|
||||
deleteTodoById(idTodo: any): Observable<any> {
|
||||
return this.http.delete(`${this.apiUrl}/todolist/delete/${idTodo}`, {
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
updateTodo(todoList: TodoList): Observable<any> {
|
||||
console.log(todoList);
|
||||
return this.http.put(`${this.apiUrl}/todolist/update/666`, todoList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue