discourse/app/assets/javascripts/admin/addon/components/staff-actions.js
David Taylor 48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00

25 lines
641 B
JavaScript

import Component from "@ember/component";
import { action } from "@ember/object";
import { tagName } from "@ember-decorators/component";
import DiscourseURL from "discourse/lib/url";
@tagName("")
export default class StaffActions extends Component {
@action
openLinks(event) {
const dataset = event.target.dataset;
if (dataset.linkPostId) {
event.preventDefault();
this.store.find("post", dataset.linkPostId).then((post) => {
DiscourseURL.routeTo(post.url);
});
} else if (dataset.linkTopicId) {
event.preventDefault();
DiscourseURL.routeTo(`/t/${dataset.linkTopicId}`);
}
}
}