connexion avec back pour page 'search'

This commit is contained in:
MiharyR 2021-12-12 01:38:18 +01:00
parent a2d5a7afc6
commit d6752acaad
6 changed files with 70 additions and 59 deletions

View file

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {HttpClient, HttpParams} from "@angular/common/http";
import {environment} from "../../../../environments/environment";
import {Observable} from "rxjs";
@ -19,10 +19,10 @@ export class MessageService
return this.http.post<any>(urlComplete, data, {withCredentials: true});
}
get(url: string): Observable<any>
get(url: string, params:HttpParams = new HttpParams()): Observable<any>
{
const urlComplete = environment.debutUrl + url ;
return this.http.get<any>(urlComplete,{withCredentials: true});
return this.http.get<any>(urlComplete,{ withCredentials: true, params: params });
}
put(url: string, data: any): Observable<any>