mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
14 lines
515 B
TypeScript
14 lines
515 B
TypeScript
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
import { getRouteApi } from '@tanstack/react-router';
|
|
import { adminNodeQueryOptions, useInvalidateAdminNode } from '@/api/admin/nodes/queries';
|
|
|
|
const nodeDetailRoute = getRouteApi('/authenticated/panel/nodes/$id');
|
|
|
|
export const useNodeDetail = () => {
|
|
const { id } = nodeDetailRoute.useParams();
|
|
const refresh = useInvalidateAdminNode(id);
|
|
const { data: node } = useSuspenseQuery(adminNodeQueryOptions(id));
|
|
|
|
return { node, refresh };
|
|
};
|