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

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

  constructor(private http: HttpClient) { }

  getSlideshow() {
    return this.http.get(
      "/assets/json/slideshow.json"
      // "http://tamtime.iamarray.xyz/wp-json/wp/v2/slideshow?_embed"
    );
  }

  getLasted() {
    return this.http.get(
      "/assets/json/place.json"
      // "http://tamtime.iamarray.xyz/wp-json/wp/v2/place?_embed"
    );
  }

  getPlaceDetail(id) {
    return this.http.get(
      "http://tamtime.iamarray.xyz/wp-json/wp/v2/place/"+id+"/?_embed"
    );
  }

  getProvPlace() {
    return this.http.get(
      "http://tamtime.iamarray.xyz/wp-json/wp/v2/place?province=8"
    )
  }

  getPlaceCat() {
    return this.http.get(
      "http://tamtime.iamarray.xyz/wp-json/wp/v2/place?placecat=17"
    )
  }

}

