import { Ffilter } from './../../interfaces/utils/forms/filters';
import { Injectable } from '@angular/core';
import { HttpClient } from "@angular/common/http"
import { Observable } from 'rxjs';
import { Site } from '../../interfaces/site/site';
import { environment } from '../../../../environments/environment';

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

  BASE_URL_API = environment.BASE_URL_API + "/allys/maps/"

  constructor(private http: HttpClient) { }

  getSites(form: Ffilter) {
    return this.http.post<Site[]>(this.BASE_URL_API, form);
  }

  getSite(id: string): Observable<Site> {
    return this.http.get<Site>(`${this.BASE_URL_API}/${id}`)
  }

}
