Skip to content

Commit

Permalink
only filter when legnth > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfidelis committed Nov 12, 2019
1 parent 96536ea commit ed8926f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node/resolvers/search/sku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit ed8926f

Please sign in to comment.