FIX: Use 1 column instead of 4 for permalink destination (#9260)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import Category from "discourse/models/category";
|
||||
import EmberObject from "@ember/object";
|
||||
|
||||
const Permalink = EmberObject.extend({
|
||||
@@ -13,6 +16,16 @@ const Permalink = EmberObject.extend({
|
||||
});
|
||||
},
|
||||
|
||||
@discourseComputed("category_id")
|
||||
category: function(category_id) {
|
||||
return Category.findById(category_id);
|
||||
},
|
||||
|
||||
@discourseComputed("external_url")
|
||||
linkIsExternal: function(external_url) {
|
||||
return !DiscourseURL.isInternal(external_url);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
return ajax("/admin/permalinks/" + this.id + ".json", {
|
||||
type: "DELETE"
|
||||
|
||||
Reference in New Issue
Block a user