{"version":3,"sources":["webpack:///./node_modules/@abaco/assets-module/src/modules/assets-module/api/StaffApi.ts"],"names":["StaffApi","http","rootPath","this","cancelTokenSource","pk_cuaa","filter","cancel","axios","CancelToken","source","filterArr","push","toUpperCase","get","params","offset","count","length","undefined","res","data","i","e","username","email","name","surname","fiscal_code","hour_type"],"mappings":"oPAOqBA,E,WAMjB,WAAYC,EAAkBC,GAAgB,uBAC1CC,KAAKF,KAAOA,EACZE,KAAKD,SAAWA,EAChBC,KAAKC,kBAAoB,K,wGAItB,WAAeC,EAAiBC,GAAhC,oGACCH,KAAKC,mBACLD,KAAKC,kBAAkBG,SAE3BJ,KAAKC,kBAAoBI,IAAMC,YAAYC,SACrCC,EAAY,GACdL,GACAK,EAAUC,KAAV,8BAAsCN,EAAOO,gBAP9C,SAiBeV,KAAKF,KAAKa,IAAV,UAAiBX,KAAKD,SAAtB,kCAAwDG,EAAxD,cAA6E,CAC3FU,OAAQ,CACJC,OAAQ,EACRC,MAAO,IACPX,OAAQK,EAAUO,OAAS,EAAIP,OAAYQ,KArBhD,OA2BH,IAVMC,EAjBH,OA0BHA,EAAIC,KAAO,GACFC,EAAI,EAAGA,EAAI,GAAIA,IACdC,EAAW,CACbC,SAAUF,EAAI,EAAI,gBAAkB,YACpCG,MAAOH,EAAI,EAAI,mBAAqB,sBACpCI,KAAM,QACNC,QAAS,UACTC,YAAaN,EAAI,EAAI,cAAgB,iBACrCO,UAAWP,EAAI,EAAI,iBAAmB,qBAE1CF,EAAIC,KAAKT,KAAKW,GApCf,yBAsCIH,EAAIC,MAtCR,iD","file":"js/chunk-2d0b23a9.f0f50e26.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 { Building, BuildingOut, BuildingFilter, BuildingType, ProductionAreaOut, ProductionAreaUpdateOut, BuildingGeometry, Council, ProductionArea } from '../models/Building';\nimport { UnitOfMeasure } from '../models/UnitsOfMeasure';\nimport { Staff } from '../models/Staff';\n\nexport default class StaffApi {\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 getStaff(pk_cuaa: number, paging: PagingParams, filter: string | null): Promise>{\n public async getStaff(pk_cuaa: number, 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(`^search_string like ${filter.toUpperCase()}`);\n }\n\n // const res = await this.http.get(`${this.rootPath}/v1/buildings/subjects/${pk_cuaa}/buildings`, {\n // params: {\n // offset: paging.offset,\n // count: paging.count,\n // filter: filterArr.length > 0 ? filterArr : undefined,\n // }\n // });\n const res = await this.http.get(`${this.rootPath}/v1/buildings/subjects/${pk_cuaa}/buildings`, {\n params: {\n offset: 0,\n count: 300,\n filter: filterArr.length > 0 ? filterArr : undefined,\n }\n });\n\n //DUMMY DATA\n res.data = [];\n for (let i = 0; i < 10; i++) {\n const e: Staff = {\n username: i % 2 ? \"administrator\" : \"base_user\",\n email: i % 2 ? \"admin@hotmail.it\" : \"basic_asd@gmail.com\",\n name: \"NIDMA\",\n surname: \"STRATOR\",\n fiscal_code: i % 2 ? \"04938586866\" : \"VBHFJIGSJISDMG\",\n hour_type: i % 2 ? \"Orario mattino\" : \"Orario pomeriggio\",\n };\n res.data.push(e);\n }\n return res.data;\n }\n\n}\n"],"sourceRoot":""}