How to create a route to pass to setDefaultHomepage

GitHub - pfaffman/discourse-custom-homepage-for-groups: Discourse theme component to change home page based on user's primary group is broken if the admin sidebar is enabled and I assign a category to the home page. It gets this error:

Error: There is no route named discovery.c/projects/19
    at P.handlersFor (route-recognizer.js:521:1)
    at o.isActiveForRoute (

AI thinks that it seems like I should be able to do something like this in an initializer:

      const router = api.container.lookup("service:router");
      const url = router.generate('discovery.category', 'project', 19);
      setDefaultHomepage(url);

And that makes Good Sense to me, but there is no router.generate.

Strange (to me, anyway) that it works until clicking on admin in the sidebar.

1 Like