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

@Injectable({
  providedIn: 'root'
})
export class VuelosService {
  private baseUrl: string = "http://localhost:9077/AVB/service/aeropuerto";

  private baseUrlS: string = "http://localhost:9077/AVB/service/escala/";

//
  constructor(private httpClient: HttpClient) { }
  
  getAeropuertos(): Observable<any[]>{
    return this.httpClient.get<any[]>(`${ this.baseUrl }/all`);
  }

  addEscala(query: any): Observable<Object>{    
    return this.httpClient.post(this.baseUrlS,query);
  }
}
