Newer
Older
CamaraComercioWeb / src / app / core / services / site / site.service.ts
Fabian VC on 23 Oct 2021 660 bytes [add] rest api
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';
import { SITES } from '../../mocks/data';

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

  BASE_URL_API = environment.BASE_URL_API + "/allys/"

  constructor(private http: HttpClient) { }

  getSites(): Observable<Site[]> {
    return this.http.get<Site[]>(this.BASE_URL_API);
  }

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

}