Files
platform/src/apps/officer-web/state/useResources.ts
T
2026-02-18 19:57:46 +00:00

32 lines
753 B
TypeScript

import { useQuery } from '@tanstack/react-query';
import { useClient } from 'hooks/useClient';
export type Resource = {
id: string;
name: string;
subtitle: string;
type: string;
port: string | null;
description: string;
installCommand: string | null;
uninstallCommand: string | null;
manageCommand: string | null;
verifyCommand: string | null;
updateCommand: string | null;
installed: boolean;
version: string | null;
};
const RESOURCES_KEY = ['RESOURCES'];
export const useResources = () => {
const client = useClient();
const { data: resources, isLoading } = useQuery({
queryKey: RESOURCES_KEY,
queryFn: () => client.get<Resource[]>('/server-settings/resources'),
});
return { resources, isLoading };
};