imagenes.service.ts 746 Bytes
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { appSettings } from 'src/etc/AppSettings';

@Injectable({
  providedIn: 'root'
})
export class ImagenesService {

  constructor(private http: HttpClient) { }

  getAllWithPaginator(search: string = '', page: number = 1): Observable<any> {

    return this.http.post(`${appSettings.apiImagenes}/articulos`, {
      page: page,
      search: search
    });
  }

  saveInBase(body): Observable<any> {

    return this.http.post(`${appSettings.apiImagenes}/imagenes/guardar`, body);
  }

  deleteImage(body): Observable<any> {

    return this.http.post(`${appSettings.apiImagenes}/imagen/borrar`, body);
  }

}