From 06f6a4f0f14de66fe5372e5f9d773e9076ee3e96 Mon Sep 17 00:00:00 2001 From: Scott Guymer Date: Fri, 2 Dec 2022 16:48:22 +0100 Subject: [PATCH] fix: allow overriding of stackoverflow configuration Make it possible to override the config when instantiating for more flexibility. Signed-off-by: Scott Guymer --- .changeset/olive-eyes-sing.md | 5 +++++ .../src/search/StackOverflowQuestionsCollatorFactory.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/olive-eyes-sing.md diff --git a/.changeset/olive-eyes-sing.md b/.changeset/olive-eyes-sing.md new file mode 100644 index 0000000000..d0ae1dc08f --- /dev/null +++ b/.changeset/olive-eyes-sing.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-stack-overflow-backend': minor +--- + +Enable configuration override for StackOverflow backend plugin when instantiating the search indexer. This makes it possible to set different configuration for frontend and backend of the plugin. diff --git a/plugins/stack-overflow-backend/src/search/StackOverflowQuestionsCollatorFactory.ts b/plugins/stack-overflow-backend/src/search/StackOverflowQuestionsCollatorFactory.ts index ebbad99d0a..807d6637c1 100644 --- a/plugins/stack-overflow-backend/src/search/StackOverflowQuestionsCollatorFactory.ts +++ b/plugins/stack-overflow-backend/src/search/StackOverflowQuestionsCollatorFactory.ts @@ -95,11 +95,11 @@ export class StackOverflowQuestionsCollatorFactory 'https://api.stackexchange.com/2.2'; const maxPage = options.maxPage || 100; return new StackOverflowQuestionsCollatorFactory({ - ...options, baseUrl, maxPage, apiKey, apiAccessToken, + ...options, }); }