import { Injectable } from '@angular/core';
import { HttpClient,HttpClientModule } from '@angular/common/http';
import { HTTP } from '@ionic-native/http/ngx';

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

  URLBASE = "http://192.168.1.141:8000/wellness/api/";
  constructor(private http: HttpClient, private httpNative: HTTP) { }

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

    getStores() {
        return this.httpNative.get(this.URLBASE + "stores", {}, {});
    }

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

  getNear() {
    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"
      "/assets/json/place173.json"
    );
  }

  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"
    )
  }

}

