// Angular Core
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

// Services
import { ApiService } from '../api/api.service';

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

  constructor(private http: HttpClient, public api: ApiService) { }

  /**
   * Gets states
   * @returns {object} promise
  */
  getStates() {
    return this.api.read('/States');
  };

  /**
   * Call back error method
   */
  errorCallBack(response: any) {
    this.api.errorCallback(response);
  };

}
