Files
llink/js/src/hooks/use-download-url.ts
T

12 lines
375 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { apiClient } from "@/api/client";
export function useDownloadUrl(objectId?: string) {
return useQuery({
queryKey: ["download-url", objectId],
queryFn: () => apiClient.getParticleDownloadUrl(objectId!),
enabled: !!objectId,
staleTime: 1000 * 60 * 60, // 1 hour — signed URLs valid for 24h
});
}