FIX: Use 1 column instead of 4 for permalink destination (#9260)

This commit is contained in:
Kane York
2020-03-25 11:30:39 -07:00
committed by GitHub
parent b09f79366e
commit 6a1fe9ff87
3 changed files with 21 additions and 13 deletions
@@ -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"