-
Hello, We recently used your (archived) plugin fork. Since I would like to migrate to the procore-oss organization version, you have introduced the usage of the Backstage API, as referenced in this commit. However, I have not been able to pass ...
import { AnnouncementCollatorFactory } from '@procore-oss/backstage-plugin-announcements-backend';
import { PgSearchEngine } from '@backstage/plugin-search-backend-module-pg';
import { Router } from 'express';
export default async function createPlugin(env: PluginEnvironment): Promise<Router> {
const searchEngine = await PgSearchEngine.fromConfig(env.config, { database: env.database });
const indexBuilder = new IndexBuilder({
logger: env.logger,
searchEngine,
});
...
// Announcements indexing
indexBuilder.addCollator({
schedule: schedule,
factory: AnnouncementCollatorFactory.fromConfig({
logger: env.logger,
discoveryApi: env.discovery,
fetchApi: env.fetchApi, // FIXME: Correctly pass fetchApi
}),
});
const { scheduler } = await indexBuilder.build();
scheduler.start();
useHotCleanup(module, () => scheduler.stop());
return await createRouter({
engine: indexBuilder.getSearchEngine(),
types: indexBuilder.getDocumentTypes(),
permissions: env.permissions,
config: env.config,
logger: env.logger,
});
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @gaelgoth, I've searched for other examples and confirmed this with a few others. I should not have moved this to use the |
Beta Was this translation helpful? Give feedback.
Hey @gaelgoth,
I've searched for other examples and confirmed this with a few others. I should not have moved this to use the
FetchApi
as it's a front-end concept. The best option is to revert to using (native) fetch, which I can take care of in the next few hours unless you see this and want to contribute.