import { Injectable } from '@angular/core';
import { Http} from '@angular/http';
import 'rxjs/add/operator/map';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { environment } from '../../../../../environments/environment.dev';

@Injectable()
export class UsecaselistService {

  private passeducforEdit = new BehaviorSubject<any>({});
  currentUC = this.passeducforEdit.asObservable();

  //Base Urls
  private baseURL= environment.apiUrl

  constructor(public http:Http) {
    console.log("UsecaselistService connected ...");
    // changeUC(uctoEdit: any) {
    //   this.passeducforEdit.next(uctoEdit)
    // }

  }

  getUsecaselist(){
      return this.http.get(this.baseURL +'orchestrate/admin-fetchUseCase/').map(res => res.json());
  }

  getAllSkillTrackDetails(){
    return this.http.get(this.baseURL +'orchestrate/common-getAllSkillTrackDtls/').map(res => res.json());
  }

  getExpLevel(){
    return this.http.get(this.baseURL +'orchestrate/common-getAllExperienceLevel/').map(res => res.json());
  }

  getTechDetails(){
    return this.http.get(this.baseURL +'orchestrate/common-getAllMiniUsecasesBySkill/').map(res => res.json());
  }
  getBusiDetails(){
    return this.http.get(this.baseURL +'orchestrate/common-getAllMainUsecasesBySkill/').map(res => res.json());
    
  }
  getQueAndAns(id){
    return this.http.get(this.baseURL +'orchestrate/admin-fetchFeedbackQuestionsByUsecaseId/'+id).map(res => res.json());
  }
}
