Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announcements search issue #182

Closed
ppiwow-apay opened this issue Sep 21, 2023 · 0 comments · Fixed by #195
Closed

Announcements search issue #182

ppiwow-apay opened this issue Sep 21, 2023 · 0 comments · Fixed by #195

Comments

@ppiwow-apay
Copy link

Hi,

I have a problem with announcements search integration. It seems that search factory is not able to build index cause by lacking of API endpoint exposed by router.

I had to add this code to make it work:

export default async function createPlugin({
  logger,
  database,
  permissions,
}: PluginEnvironment): Promise<Router> {
  const announcementsContext = await buildAnnouncementsContext({
    logger: logger,
    database: database,
    permissions: permissions
  });

  const router = await createRouter(announcementsContext);

  // TODO: seems that there is an error in plugin
  router.get(
    '/',
    async (
      req,
      res,
    ) => {
        const list = await announcementsContext.persistenceContext.announcementsStore.announcements({});
        return res.json(list.results);
    },
  );
  return router;
}

plugin version: "@k-phoen/backstage-plugin-announcements-backend": "^0.2.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant