chore: debug info use query

This commit is contained in:
Joel
2024-11-08 15:10:06 +08:00
parent 6fcebf3ecd
commit edc2fe050a
2 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import type { InstalledPluginListResponse } from '@/app/components/plugins/types'
import type { DebugInfo as DebugInfoTypes, InstalledPluginListResponse } from '@/app/components/plugins/types'
import { get } from './base'
import {
useQueryClient,
@ -27,3 +27,10 @@ export const useInvalidateInstalledPluginList = () => {
})
}
}
export const useDebugKey = () => {
return useQuery({
queryKey: [NAME_SPACE, 'debugKey'],
queryFn: () => get<DebugInfoTypes>('/workspaces/current/plugin/debugging-key'),
})
}