Skip to content

Commit

Permalink
Convert ActivityPubCategory route to modern class
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Oct 23, 2024
1 parent f2de51c commit 6e35b7b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions assets/javascripts/discourse/routes/activity-pub-category.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import Category from "discourse/models/category";
import DiscourseRoute from "discourse/routes/discourse";
import ActivityPubActor from "../models/activity-pub-actor";

export default DiscourseRoute.extend({
router: service(),
export default class ActivityPubCategory extends DiscourseRoute {
@service router;

model(params) {
return Category.findById(params.category_id);
},
}

setupController(controller, model) {
controller.setProperties({ model });
},
}

@action
follow(actor, followActor) {
Expand All @@ -23,7 +23,7 @@ export default DiscourseRoute.extend({
).model.actors.unshiftObject(followActor);
return result;
});
},
}

@action
unfollow(actor, followedActor) {
Expand All @@ -35,7 +35,7 @@ export default DiscourseRoute.extend({
return result;
}
);
},
}

@action
reject(actor, followingActor) {
Expand All @@ -47,5 +47,5 @@ export default DiscourseRoute.extend({
return result;
}
);
},
});
}
}

0 comments on commit 6e35b7b

Please sign in to comment.