Revert "topic fixup" (#11223)
The review queue page fails to load with the error: "TypeError: category is null"
This reverts commit 19b7cdd21f
.
This commit is contained in:
parent
89fc11e93b
commit
ffd1b7c234
|
@ -225,14 +225,8 @@ const Topic = RestModel.extend({
|
|||
},
|
||||
|
||||
@discourseComputed("category_id")
|
||||
category: {
|
||||
get(categoryId) {
|
||||
return Category.findById(categoryId);
|
||||
},
|
||||
set(category) {
|
||||
this.set("category_id", category.id);
|
||||
return category;
|
||||
},
|
||||
category(categoryId) {
|
||||
return Category.findById(categoryId);
|
||||
},
|
||||
|
||||
categoryClass: fmt("category.fullSlug", "category-%@"),
|
||||
|
|
|
@ -4,7 +4,7 @@ import Category from "discourse/models/category";
|
|||
import Topic from "discourse/models/topic";
|
||||
import User from "discourse/models/user";
|
||||
import { discourseModule } from "discourse/tests/helpers/qunit-helpers";
|
||||
import createStore from "discourse/tests/helpers/create-store";
|
||||
import EmberObject from "@ember/object";
|
||||
|
||||
discourseModule("Unit | Model | topic", function () {
|
||||
test("defaults", function (assert) {
|
||||
|
@ -36,9 +36,7 @@ discourseModule("Unit | Model | topic", function () {
|
|||
});
|
||||
|
||||
test("lastUnreadUrl", function (assert) {
|
||||
const store = createStore();
|
||||
const category = store.createRecord("category", {
|
||||
id: 1,
|
||||
const category = EmberObject.create({
|
||||
navigate_to_first_post_after_read: true,
|
||||
});
|
||||
|
||||
|
@ -47,9 +45,10 @@ discourseModule("Unit | Model | topic", function () {
|
|||
highest_post_number: 10,
|
||||
last_read_post_number: 10,
|
||||
slug: "hello",
|
||||
category_id: category.id,
|
||||
});
|
||||
|
||||
topic.set("category", category);
|
||||
|
||||
assert.equal(topic.get("lastUnreadUrl"), "/t/hello/101/1");
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue