From b619490fe0f57694fcd0687b1a7c32f38c1c9403 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 10 Jun 2020 13:58:50 +0200 Subject: [PATCH] chore(catalog/star): only set the cache if there are entries from the response --- plugins/catalog/src/api/CatalogClient.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/catalog/src/api/CatalogClient.ts b/plugins/catalog/src/api/CatalogClient.ts index 39e6ca8360..1d88a57ecc 100644 --- a/plugins/catalog/src/api/CatalogClient.ts +++ b/plugins/catalog/src/api/CatalogClient.ts @@ -77,7 +77,11 @@ export class CatalogClient implements CatalogApi { ); } const value = await response.json(); - this.cache.set(`get:${JSON.stringify(filter)}`, value); + + if (value?.length) { + this.cache.set(`get:${JSON.stringify(filter)}`, value); + } + return value; }