{"version":3,"sources":["webpack:///./node_modules/@abaco/crop-plan-module/src/modules/crop-plan-module/api/CouncilApi.ts"],"names":["CouncilApi","http","this","filter","paging","filters","push","toUpperCase","get","params","offset","count","res","data","councilId","get_mbr","records","mbr"],"mappings":"yMAIqBA,G,qBAIjB,WAAYC,GAAgB,uBACxBC,KAAKD,KAAOA,E,2GAGhB,WAAkBE,EAAuBC,GAAzC,gGACUC,EAAU,CAAC,kBACdF,GACCE,EAAQC,KAAR,8BAAoCH,EAAOI,gBAHnD,SAKsBL,KAAKD,KAAKO,IAAI,4DAA6D,CACzFC,OAAQ,CACJC,OAAQN,EAAOM,OACfC,MAAOP,EAAOO,MACdR,OAAQE,KATpB,cAKUO,EALV,yBAaWA,EAAIC,MAbf,gD,gJAgBA,WAAoBC,GAApB,uGACsBZ,KAAKD,KAAKO,IAAI,4DAA6D,CACzFC,OAAQ,CACJC,OAAQ,EACRC,MAAO,EACPR,OAAQ,iBAAF,OAAmBW,GACzBC,SAAS,KANrB,cACUH,EADV,yBAUWA,EAAIC,KAAKG,QAAQ,GAAGC,KAV/B,gD","file":"js/chunk-2d0aa263.7107f03a.js","sourcesContent":["import { Council } from '../models/Council';\nimport { PagingParams, PagedResults } from '@abaco/web-common/src/Paging';\nimport { HTTPClient } from '@abaco/web-common/src/HTTP';\nimport { PlotGeom } from '@abaco/portal-global-state/src/modules/global-state/models/Plot';\nexport default class CouncilApi {\n\n private http: HTTPClient;\n\n constructor(http: HTTPClient){\n this.http = http;\n }\n\n async getCouncils(filter: string | null, paging: PagingParams): Promise> {\n const filters = [\"fg_active eq 1\"];\n if(filter) {\n filters.push(`^council_label like ${filter.toUpperCase()}`)\n }\n const res = await this.http.get(\"/sitiagri-rest-api/api_basic/v1/plots/dictionary_councils\", {\n params: {\n offset: paging.offset,\n count: paging.count,\n filter: filters,\n }\n });\n\n return res.data;\n }\n\n async getCouncilMbr(councilId: number): Promise {\n const res = await this.http.get(\"/sitiagri-rest-api/api_basic/v1/plots/dictionary_councils\", {\n params: {\n offset: 0,\n count: 1,\n filter: `council_id eq ${councilId}`,\n get_mbr: true\n }\n });\n\n return res.data.records[0].mbr;\n }\n}\n"],"sourceRoot":""}