mirror of
https://github.com/langgenius/dify.git
synced 2025-07-03 23:28:18 +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,
|
||
|
})
|
||
|
}
|