* wip * wip * wip * format * wip(mobile): lint and format * cleanup * nits * nits * idiomatic react * nit * format all root files
13 lines
395 B
TypeScript
13 lines
395 B
TypeScript
import { useQuery, skipToken } from '@tanstack/react-query';
|
|
import { apiClient } from '@/api/client';
|
|
|
|
export function useDownloadUrl(objectId?: string) {
|
|
return useQuery({
|
|
queryKey: ['download-url', objectId],
|
|
queryFn: objectId
|
|
? () => apiClient.getParticleDownloadUrl(objectId)
|
|
: skipToken,
|
|
staleTime: 1000 * 60 * 60, // 1 hour — signed URLs valid for 24h
|
|
});
|
|
}
|