update: use fluentApi to fetch images in resolvers

This commit is contained in:
MTG2000
2022-09-13 10:52:34 +03:00
parent 63286d878a
commit 60ecbefc97
7 changed files with 448 additions and 364 deletions

View File

@@ -20,7 +20,7 @@ const PROVIDERS = [
* @returns {string} image url
*/
function resolveImgObjectToUrl(imgObject, variant = null) {
if (!imgObject) throw new Error('Image not found')
if (!imgObject) return null;
if (imgObject.provider === 'external') {
return imgObject.url