mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-01 06:49:30 +00:00
The initial setup done in fb0d56324f9139f432c8797f25c30151ae66723b clashed with other plugins, I found this when trying to do the same for Gamification. This uses a better routing setup and removes the need to define the config nav link for Settings -- that is always inserted. Relies on https://github.com/discourse/discourse/pull/26707
20 lines
497 B
JavaScript
20 lines
497 B
JavaScript
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default DiscourseRoute.extend({
|
|
async model(params) {
|
|
const allPersonas = this.modelFor(
|
|
"adminPlugins.show.discourse-ai-personas"
|
|
);
|
|
const id = parseInt(params.id, 10);
|
|
return allPersonas.findBy("id", id);
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
this._super(controller, model);
|
|
controller.set(
|
|
"allPersonas",
|
|
this.modelFor("adminPlugins.show.discourse-ai-personas")
|
|
);
|
|
},
|
|
});
|