{"version":3,"sources":["webpack:///./node_modules/@abaco/assets-module/src/modules/assets-module/api/CombinationApi.ts"],"names":["CombinationApi","http","rootPath","this","cancelTokenSource","pk_cuaa","paging","filter","filterArr","push","toUpperCase","get","params","offset","count","length","undefined","cancelToken","token","res","data","pkCuaa","elId","detailOut","put","post","delete"],"mappings":"yMAKqBA,G,+BAMjB,WAAYC,EAAkBC,GAAgB,uBAC1CC,KAAKF,KAAOA,EACZE,KAAKD,SAAWA,EAChBC,KAAKC,kBAAoB,K,+GAGtB,WAAsBC,EAAiBC,EAAsBC,GAA7D,kGAKGC,EAAY,GACdD,GACAC,EAAUC,KAAV,4BAAoCF,EAAOG,gBAP5C,SASeP,KAAKF,KAAKU,IAAV,UAAiBR,KAAKD,SAAtB,mCAAyDG,EAAzD,8BAA8F,CAC5GO,OAAQ,CACJC,OAAQP,EAAOO,OACfC,MAAOR,EAAOQ,MACdP,OAAQC,EAAUO,OAAS,EAAIP,OAAYQ,GAE/CC,YAAW,UAAEd,KAAKC,yBAAP,aAAE,EAAwBc,QAftC,cASGC,EATH,yBAkBIA,EAAIC,MAlBR,gD,mJAqBA,WAAqBC,EAAgBC,GAArC,uGACenB,KAAKF,KAAKU,IAAV,UAAiBR,KAAKD,SAAtB,mCAAyDmB,EAAzD,yBAAgFC,IAD/F,cACGH,EADH,yBAEIA,EAAIC,MAFR,gD,kJAIA,WAAsBC,EAAgBC,EAAcC,GAApD,uGACepB,KAAKF,KAAKuB,IAAV,UAAiBrB,KAAKD,SAAtB,mCAAyDmB,EAAzD,yBAAgFC,GAAQC,GADvG,cACGJ,EADH,yBAEIA,EAAIC,MAFR,gD,sJAIA,WAAwBC,EAAgBE,GAAxC,uGACepB,KAAKF,KAAKwB,KAAV,UAAkBtB,KAAKD,SAAvB,mCAA0DmB,EAA1D,iBAAiFE,GADhG,cACGJ,EADH,yBAEIA,EAAIC,MAFR,gD,oJAIA,WAAwBC,EAAgBC,GAAxC,uGACenB,KAAKF,KAAKyB,OAAV,UAAoBvB,KAAKD,SAAzB,mCAA4DmB,EAA5D,yBAAmFC,IADlG,cACGH,EADH,yBAEIA,EAAIC,MAFR,gD","file":"js/chunk-2d0c06c3.4f22fd1a.js","sourcesContent":["import { HTTPClient } from '@abaco/web-common/src/HTTP';\nimport axios, { CancelTokenSource } from \"axios\";\nimport { PagedResults, PagingParams } from '@abaco/web-common/src/Paging';\nimport { Combination, CombinationOut, CombinationUpdateOut } from '../models/Combination';\n\nexport default class CombinationApi {\n\n private http: HTTPClient;\n private rootPath: string;\n private cancelTokenSource: CancelTokenSource | null;\n\n constructor(http: HTTPClient, rootPath: string) {\n this.http = http;\n this.rootPath = rootPath;\n this.cancelTokenSource = null;\n }\n\n public async getCombinations(pk_cuaa: number, paging: PagingParams, filter: string | null): Promise>{\n // if (this.cancelTokenSource) {\n // this.cancelTokenSource.cancel();\n // }\n //this.cancelTokenSource = axios.CancelToken.source();\n const filterArr = [];\n if (filter) {\n filterArr.push(`^description like ${filter.toUpperCase()}`);\n }\n const res = await this.http.get(`${this.rootPath}/v1/equipments/subjects/${pk_cuaa}/combinations?preview=true`, {\n params: {\n offset: paging.offset,\n count: paging.count,\n filter: filterArr.length > 0 ? filterArr : undefined,\n },\n cancelToken: this.cancelTokenSource?.token\n })\n\n return res.data;\n }\n\n public async getCombination(pkCuaa: number, elId: number): Promise {\n const res = await this.http.get(`${this.rootPath}/v1/equipments/subjects/${pkCuaa}/combinations/${elId}`);\n return res.data;\n }\n public async editCombination(pkCuaa: number, elId: number, detailOut: CombinationUpdateOut): Promise {\n const res = await this.http.put(`${this.rootPath}/v1/equipments/subjects/${pkCuaa}/combinations/${elId}`, detailOut);\n return res.data;\n }\n public async insertCombination(pkCuaa: number, detailOut: CombinationOut): Promise {\n const res = await this.http.post(`${this.rootPath}/v1/equipments/subjects/${pkCuaa}/combinations`, detailOut);\n return res.data;\n }\n public async deleteCombination(pkCuaa: number, elId: number): Promise {\n const res = await this.http.delete(`${this.rootPath}/v1/equipments/subjects/${pkCuaa}/combinations/${elId}`);\n return res.data;\n }\n\n}\n"],"sourceRoot":""}