Skip to content

Commit

Permalink
Fix: Use resources as a source of truth (#1956)
Browse files Browse the repository at this point in the history
* blocks calls to the API for path segments

* only make calls when querying parameters

Co-authored-by: Elinor <[email protected]>
  • Loading branch information
thewahome and ElinorW authored Aug 1, 2022
1 parent 3fa47b0 commit 4c7b554
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/modules/suggestions/suggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4c7b554

Please sign in to comment.