text: import request from "@/utils/request";
  
  /**
   *
   * @param {number} pageSize
   * @param {number} currentPage
   * @param {string} currentPage
   */
  export function getList(pageSize, currentPage, filterText = null) {
    var url = `/trainingProgram/program?size=${pageSize}&page=${currentPage}`;
  
    if (filterText) url += `&filter=${filterText}`;
  
    return request({
      url,
      method: "get"
    });
  }
  
  export function getDetail(id) {
    return request({
      url: `/trainingProgram/program/${id}`,
      method: "get"
    });
  }
  
  export function getByYearAndOccupationalClassId(year, id) {
    return request({
      url: `/trainingProgram/year/${year}/occupationalClass/${id}`,
      method: "get"
    });
  }
  
  export function store(data) {
    return request({
      url: "/trainingProgram/program",
      method: "post",
      data
    });
  }
  
  export function update(id, data) {
    return request({
      url: `/trainingProgram/program/${id}`,
      method: "put",
      data
    });
  }
  
  export function destroy(id) {
    return request({
      url: `/trainingProgram/program/${id}`,
      method: "DELETE"
    });
  }
  
  export function getTrainingProgramRoles() {
    return request({
      url: `/nominalRole/type/2`,
      method: "GET"
    });
  }
  
  export function getProgramUnitRoles() {
    return request({
      url: `/nominalRole/type/3`,
      method: "GET"
    });
  }
  
  export function getProgramStepRoles() {
    return request({
      url: `/nominalRole/type/4`,
      method: "GET"
    });
  }
  
  export function getYears() {
    return request({
      url: `/trainingProgram/years`,
      method: "GET"
    });
  }
  
  export function getStepsByUserIdAndYear(id, year = null) {
    return request({
      url: `trainingProgram/step/user/${id}/year/${year || ""}`,
      method: "GET"
    });
  }
  