import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

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

  constructor(private http : HttpClient) { }

  headers() {
    return this.http.get('/napi/coloring/web/collection/headers');
  }

  pagerAll(query: string) {
    return this.http.get(`/napi/coloring/web/collection/all?${query}`);
  }

  get(id: string) {
    return this.http.get(`/napi/coloring/web/collection/${id}`)
  }

  /**
   * update collection.
   * @param data FormData
   */
  update(data: FormData, id: string) {
    return this.http.patch(`/napi/coloring/web/collection/${id}`, data);
  }

  add(data) {
    return this.http.post('/napi/coloring/web/collection/', data);
  }

  remove(id) {
    return this.http.delete(`/napi/coloring/web/collection/${id}`);
  }

  translateOptions() {
    return this.http.get('/napi/web/translate/options');
  }

  epgOption() {
    return this.http.get('/napi/web/epg/options');
  }
  
}
