From 9feafe70fcebdfeeefc6f2223417c5bf5f7b128c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Thu, 26 Mar 2020 19:49:15 +0100 Subject: [PATCH] Make width optional for getThumbnail function --- src/utils/functions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/functions.js b/src/utils/functions.js index d1efc16..cafbe64 100644 --- a/src/utils/functions.js +++ b/src/utils/functions.js @@ -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}` }