mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-04-29 00:30:11 +00:00
BETTERZON-42: Functionality and design of various components for the search product UC
This commit is contained in:
@@ -19,17 +19,24 @@ export class ApiService {
|
||||
getProduct(id): Observable<Product> {
|
||||
try {
|
||||
const prod = this.http.get<Product>((this.apiUrl + '/products/' + id));
|
||||
console.log(prod);
|
||||
return prod;
|
||||
} catch (exception) {
|
||||
process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`);
|
||||
}
|
||||
}
|
||||
|
||||
getProductsByQuery(query): Observable<Product[]> {
|
||||
try {
|
||||
const prods = this.http.get<Product[]>((this.apiUrl + '/products/search/' + query));
|
||||
return prods;
|
||||
} catch (exception) {
|
||||
process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`);
|
||||
}
|
||||
}
|
||||
|
||||
getProducts(): Observable<Product[]> {
|
||||
try {
|
||||
const prods = this.http.get<Product[]>((this.apiUrl + '/products'));
|
||||
console.log(prods);
|
||||
return prods;
|
||||
} catch (exception) {
|
||||
process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`);
|
||||
|
||||
Reference in New Issue
Block a user