diff --git a/app/assets/javascripts/discourse/models/category.js b/app/assets/javascripts/discourse/models/category.js index f19c5b930c9..49071428f40 100644 --- a/app/assets/javascripts/discourse/models/category.js +++ b/app/assets/javascripts/discourse/models/category.js @@ -240,7 +240,6 @@ Discourse.Category.reopenClass({ }, findBySlug: function(slug, parentSlug) { - var categories = Discourse.Category.list(), category; @@ -268,8 +267,8 @@ Discourse.Category.reopenClass({ return category; }, - reloadBySlugOrId: function(slugOrId) { - return Discourse.ajax("/category/" + slugOrId + "/show.json").then(function (result) { + reloadById: function(id) { + return Discourse.ajax("/category/" + id + "/show.json").then(function (result) { return Discourse.Category.create(result.category); }); } diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index 72484332d02..e37aff147e3 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -114,7 +114,7 @@ var ApplicationRoute = Em.Route.extend({ Discourse.Route.showModal(router, 'editCategory', category); router.controllerFor('editCategory').set('selectedTab', 'general'); } else { - Discourse.Category.reloadBySlugOrId(category.get('slug') || category.get('id')).then(function (c) { + Discourse.Category.reloadById(category.get('id')).then(function (c) { Discourse.Site.current().updateCategory(c); Discourse.Route.showModal(router, 'editCategory', c); router.controllerFor('editCategory').set('selectedTab', 'general');