mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 02:42:59 +00:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			406 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			406 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|   | import { useQuery } from '@tanstack/react-query' | ||
|  | import { getAppAccessModeByAppCode } from './share' | ||
|  | 
 | ||
|  | const NAME_SPACE = 'webapp' | ||
|  | 
 | ||
|  | export const useAppAccessModeByCode = (code: string | null) => { | ||
|  |   return useQuery({ | ||
|  |     queryKey: [NAME_SPACE, 'appAccessMode', code], | ||
|  |     queryFn: () => { | ||
|  |       if (!code) | ||
|  |         return null | ||
|  | 
 | ||
|  |       return getAppAccessModeByAppCode(code) | ||
|  |     }, | ||
|  |     enabled: !!code, | ||
|  |   }) | ||
|  | } |