2025-07-17 11:17:49 +08:00
|
|
|
import { useQuery } from '@tanstack/react-query'
|
|
|
|
import { get } from './base'
|
2025-07-21 17:40:19 +08:00
|
|
|
import { useInvalid } from './use-base'
|
2025-07-17 11:17:49 +08:00
|
|
|
import type { DataSourceAuth } from '@/app/components/header/account-setting/data-source-page-new/types'
|
|
|
|
|
|
|
|
const NAME_SPACE = 'data-source-auth'
|
|
|
|
|
|
|
|
export const useGetDataSourceListAuth = () => {
|
|
|
|
return useQuery({
|
|
|
|
queryKey: [NAME_SPACE, 'list'],
|
|
|
|
queryFn: () => get<{ result: DataSourceAuth[] }>('/auth/plugin/datasource/list'),
|
|
|
|
retry: 0,
|
|
|
|
})
|
|
|
|
}
|
2025-07-21 17:40:19 +08:00
|
|
|
|
|
|
|
export const useInvalidDataSourceListAuth = (
|
|
|
|
) => {
|
|
|
|
return useInvalid([NAME_SPACE, 'list'])
|
|
|
|
}
|