From ed8926f04214ee9d2683fdb10a307ce6acbff5c1 Mon Sep 17 00:00:00 2001 From: Joao Fidelis Date: Mon, 11 Nov 2019 18:00:10 -0300 Subject: [PATCH] only filter when legnth > 1 --- node/resolvers/search/sku.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/resolvers/search/sku.ts b/node/resolvers/search/sku.ts index cf56736..22f866b 100644 --- a/node/resolvers/search/sku.ts +++ b/node/resolvers/search/sku.ts @@ -20,7 +20,7 @@ export const resolvers = { { quantity, filter }: { quantity: number; filter: ImagesFilter } ) => { let filtered = images - if (filter === ImagesFilter.WITH_LABEL) { + if (filter === ImagesFilter.WITH_LABEL && images.length > 1) { // We still want to return the first image because it usually is the main image filtered = [ head(images),