From 4c7b5545d0deb1c5252ec07b4a2c1a1216a681ab Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Mon, 1 Aug 2022 18:37:46 +0300 Subject: [PATCH] Fix: Use resources as a source of truth (#1956) * blocks calls to the API for path segments * only make calls when querying parameters Co-authored-by: Elinor --- src/modules/suggestions/suggestions.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/suggestions/suggestions.ts b/src/modules/suggestions/suggestions.ts index b614fd36f..2ef3f97a9 100644 --- a/src/modules/suggestions/suggestions.ts +++ b/src/modules/suggestions/suggestions.ts @@ -26,7 +26,15 @@ class Suggestions implements ISuggestions { return localOptions; } - return this.fetchSuggestionsFromNetwork(url, api, version); + /* + * blocks calls to the API for path segments + * uses resource explorer and cache as source of truth + */ + if (context === 'parameters') { + return this.fetchSuggestionsFromNetwork(url, api, version); + } + + return null; } private async getSuggestionsFromResources(url: string, version: string,