{"version":3,"file":"useUsersQuery-mF6onKZi.js","sources":["../../../frontend/src/Hooks/useUsersQuery.ts"],"sourcesContent":["import { useQuery } from 'react-query';\n\nimport { getUsers } from '../Services/Api';\n\nconst useUsersQuery = (\n key: any,\n { post, limit, page = 0, filter, search = '', sort, useQueryProps }: any,\n) => {\n const { data, ...params } = useQuery(\n [key, page, post, filter, search, sort],\n () =>\n getUsers({\n limit,\n page,\n filter,\n sort,\n search,\n }),\n {\n enabled: !!window.spaceSlug,\n select: (response: any) => response.data,\n keepPreviousData: true,\n refetchOnWindowFocus: false,\n ...useQueryProps,\n },\n );\n\n return {\n users: data?.data || [],\n paging: data?.paging || { total: 0 },\n usersCount: data?.paging?.total || 0,\n ...params,\n };\n};\n\nexport default useUsersQuery;\n"],"names":["useUsersQuery","key","_ref","_data$paging","post","limit","_ref$page","page","filter","_ref$search","search","sort","useQueryProps","_useQuery","useQuery","getUsers","_objectSpread","enabled","window","spaceSlug","select","response","data","keepPreviousData","refetchOnWindowFocus","params","_objectWithoutProperties","_excluded","users","paging","total","usersCount"],"mappings":"8pDAIA,IAAMA,EAAgB,SACpBC,EAAQC,EAEL,CAAAC,IAAAA,EADDC,EAAIF,EAAJE,KAAMC,EAAKH,EAALG,MAAKC,EAAAJ,EAAEK,KAAAA,EAAID,IAAG,OAAA,EAACA,EAAEE,EAAMN,EAANM,OAAMC,EAAAP,EAAEQ,OAAAA,EAAMD,IAAG,OAAA,GAAEA,EAAEE,EAAIT,EAAJS,KAAMC,EAAaV,EAAbU,cAEpDC,EAA4BC,EAC1B,CAACb,EAAKM,EAAMH,EAAMI,EAAQE,EAAQC,CAAI,EACtC,UAAA,CAAA,OACEI,EAAS,CACPV,MAAAA,EACAE,KAAAA,EACAC,OAAAA,EACAG,KAAAA,EACAD,OAAAA,CAAAA,CACD,GAACM,EAAA,CAEFC,QAAS,CAAC,CAACC,OAAOC,UAClBC,OAAQ,SAACC,EAAa,CAAA,OAAKA,EAASC,IAAI,EACxCC,iBAAkB,GAClBC,qBAAsB,EAAA,EACnBZ,CAAa,CAEpB,EAjBQU,EAAIT,EAAJS,KAASG,EAAMC,EAAAb,EAAAc,CAAA,EAmBvB,OAAAX,EAAA,CACEY,OAAON,GAAAA,YAAAA,EAAMA,OAAQ,CAAE,EACvBO,QAAQP,GAAI,KAAJA,OAAAA,EAAMO,SAAU,CAAEC,MAAO,CAAE,EACnCC,YAAYT,GAAAA,OAAInB,EAAJmB,EAAMO,UAAM1B,MAAAA,kBAAZA,EAAc2B,QAAS,GAChCL,CAAM,CAEb"}