import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { SobreDoenca } from 'src/app/models/sobre-doenca/sobre-doenca.model';

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

  private readonly URL = 'https://3000-yasmimtcc-3egb2023tcche-jzxp8591avr.ws-us106.gitpod.io/'
  constructor(private readonly _http : HttpClient) { }

  buscarDoencas(): Observable<any> {
    return this._http.get(`${this.URL}doencas`)
  }

  buscarDoencasMaisBuscadas(): Observable<any> {
    return this._http.get(`${this.URL}doencas/mais-buscadas`)
  }

  buscarDoencaPorId(id: any): Observable<any>{
    return this._http.get(`${this.URL}doencas/${id}`)
  }

}


