Make width optional for getThumbnail function
This commit is contained in:
@@ -6,6 +6,7 @@ import { apiEndpoints } from './store'
|
||||
*/
|
||||
export const getThumbnail = (id, width, height, type = 'crop', quality = 75) => {
|
||||
const ratio = 1.5
|
||||
width = !width ? Math.round(height * ratio) : width
|
||||
height = !height ? Math.round(width / ratio) : height
|
||||
return `${apiEndpoints.rest}/assets/${id}?w=${width}&h=${height}&f=${type}&q=${quality}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user