All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m2s
18 lines
385 B
TypeScript
18 lines
385 B
TypeScript
export const useDirectusFiles = () => {
|
|
const getFileUrl = (
|
|
id?: string | null,
|
|
options?: Record<string, string | number | boolean>
|
|
): string => {
|
|
if (!id) return '';
|
|
|
|
const params = new URLSearchParams(
|
|
options as Record<string, string>
|
|
).toString();
|
|
return `/api/assets/${id}${params ? `?${params}` : ''}`;
|
|
};
|
|
|
|
return {
|
|
getFileUrl,
|
|
};
|
|
};
|