🔥 Use Directus Storage Assets Presets only for images
Block the generation of other image sizes from the URL TODO: Block the access to root asset url as it still displays the original file
This commit is contained in:
@@ -19,4 +19,15 @@ export const getAssetUrl = (
|
||||
if (format) args += `&format=${format}`
|
||||
|
||||
return `${API_URL}/assets/${id}?width=${width}&height=${height}&fit=${fit}${args}`
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Directus asset URL from parameters
|
||||
*/
|
||||
export const getAssetUrlKey = (
|
||||
id: string,
|
||||
key: string
|
||||
) => {
|
||||
return `${API_URL}/assets/${id}?key=${key}`
|
||||
}
|
||||
Reference in New Issue
Block a user