File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/features/instance/operations/queries Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1+ import { isLocalStudio } from '@/config/constants' ;
12import { InstanceClientIdConfig } from '@/config/instanceClientConfig' ;
23import { queryOptions } from '@tanstack/react-query' ;
34
@@ -30,11 +31,18 @@ interface UsageLicense {
3031export function getUsageLicensesQueryOptions ( { entityId, instanceClient } : InstanceClientIdConfig ) {
3132 return queryOptions ( {
3233 queryKey : [ entityId , 'get_usage_licenses' ] as const ,
34+ enabled : ! isLocalStudio ,
3335 queryFn : async ( ) => {
34- const { data } = await instanceClient . post < UsageLicense [ ] > ( '/' , {
35- operation : 'get_usage_licenses' ,
36- } ) ;
37- return data ;
36+ try {
37+ const { data } = await instanceClient . post < UsageLicense [ ] > ( '/' , {
38+ operation : 'get_usage_licenses' ,
39+ } ) ;
40+ return data ;
41+ }
42+ catch ( err ) {
43+ console . error ( err ) ;
44+ return null ;
45+ }
3846 } ,
3947 } ) ;
4048}
You can’t perform that action at this time.
0 commit comments