Product Error on *ngIf, new a dealbreaker, but not sure.
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {catchError} from 'rxjs/operators';
|
||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||
import {Product} from '../core/product';
|
||||
import {ErrorLoggerService} from '../core/error-logger.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Product } from '../core/product';
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({'Content-Type': 'application/json'})
|
||||
@ -48,6 +48,13 @@ export class ProductService {
|
||||
);
|
||||
}
|
||||
|
||||
updateSortOrder(list: Product[]): Observable<boolean> {
|
||||
return <Observable<boolean>>this.http.post<Product[]>(url, list, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'updateSortOrder'))
|
||||
);
|
||||
}
|
||||
|
||||
saveOrUpdate(product: Product): Observable<Product> {
|
||||
if (!product.id) {
|
||||
return this.save(product);
|
||||
|
||||
Reference in New Issue
Block a user