{"version":3,"file":"useUserLimits-MZ04sUai.js","sources":["../../../packs/frontend/composables/useUserLimits.ts"],"sourcesContent":["import { useApiClient } from \"@/composables/useApiClient\";\nimport type { UserLimit } from \"@/services/fobizzToolsApi\";\nimport { useQuery, useQueryClient } from \"@tanstack/vue-query\";\n\nexport function useUserLimits() {\n const userLimits = computed(() => {\n if (data.value) {\n return data.value;\n }\n return [] as UserLimit[];\n });\n\n const queryClient = useQueryClient();\n\n const { userLimits: userLimitsService } = useApiClient();\n const { data } = useQuery(\n {\n queryKey: [\"userLimits\"],\n queryFn: () => userLimitsService.allLimits(),\n },\n queryClient\n );\n\n const refresh = () => {\n queryClient.invalidateQueries({ queryKey: [\"userLimits\"] });\n };\n\n return {\n userLimits,\n refresh,\n };\n}\n"],"names":["useUserLimits","userLimits","computed","data","queryClient","useQueryClient","userLimitsService","useApiClient","useQuery"],"mappings":"sIAIO,SAASA,GAAgB,CACxB,MAAAC,EAAaC,EAAS,IACtBC,EAAK,MACAA,EAAK,MAEP,CAAC,CACT,EAEKC,EAAcC,EAAe,EAE7B,CAAE,WAAYC,CAAkB,EAAIC,EAAa,EACjD,CAAE,KAAAJ,GAASK,EACf,CACE,SAAU,CAAC,YAAY,EACvB,QAAS,IAAMF,EAAkB,UAAU,CAC7C,EACAF,CACF,EAMO,MAAA,CACL,WAAAH,EACA,QANc,IAAM,CACpBG,EAAY,kBAAkB,CAAE,SAAU,CAAC,YAAY,EAAG,CAC5D,CAKA,CACF"}