diff --git a/comments/app.js b/comments/app.js index cde265d0676775f34c9e2c80c9687ba1fea796f3..70ccd5f3e5467f8b21b12f7f44bd416e48bbf6b4 100644 --- a/comments/app.js +++ b/comments/app.js @@ -125,21 +125,21 @@ app.get('/auth/:sdk/:version/comments_recent', function(req, res) { // Returns top users (with most upvotes or with most comments). app.get('/auth/:sdk/:version/users', function(req, res) { new Request(req).getTopUsers(req.query.sortBy, function(users) { - res.json(users); + res.json({ success: true, data: users }); }); }); // Returns the most commented targets. app.get('/auth/:sdk/:version/targets', function(req, res) { - new Request(req).getTopTargets(function(users) { - res.json(users); + new Request(req).getTopTargets(function(targets) { + res.json({ success: true, data: targets }); }); }); // Returns the most used tags. app.get('/auth/:sdk/:version/tags', function(req, res) { new Request(req).getTopTags(function(tags) { - res.send({ success: true, tags: tags }); + res.send({ success: true, data: tags }); }); }); diff --git a/template/app/view/comments/TagEditor.js b/template/app/view/comments/TagEditor.js index b0e83f574b99532de94dc6e52df00a560f4a3cdf..0584c5d2d97d53451a4269ba724038fe2bd2b009 100644 --- a/template/app/view/comments/TagEditor.js +++ b/template/app/view/comments/TagEditor.js @@ -19,7 +19,7 @@ Ext.define("Docs.view.comments.TagEditor", { url: Docs.Comments.buildRequestUrl("/tags"), reader: { type: "json", - root: "tags" + root: "data" } }, listeners: { diff --git a/template/app/view/comments/Tags.js b/template/app/view/comments/Tags.js index 6e88223931c5feb60a013eeabd0778ffc171a4d9..670a3198a9fdbfe261784a5672be529de12897d4 100644 --- a/template/app/view/comments/Tags.js +++ b/template/app/view/comments/Tags.js @@ -114,6 +114,6 @@ Ext.define('Docs.view.comments.Tags', { }, loadTags: function(tags) { - this.list.getStore().loadData(tags.tags); + this.list.getStore().loadData(tags.data); } }); diff --git a/template/app/view/comments/Targets.js b/template/app/view/comments/Targets.js index 7694544362ef4c826c1a92be42a9efc6907e374e..84727aca6d0fde2d175458fc9939e2bc585d16db 100644 --- a/template/app/view/comments/Targets.js +++ b/template/app/view/comments/Targets.js @@ -114,7 +114,7 @@ Ext.define('Docs.view.comments.Targets', { }, loadTargets: function(targets) { - this.list.getStore().loadData(Ext.Array.map(targets, this.convertTarget, this)); + this.list.getStore().loadData(Ext.Array.map(targets.data, this.convertTarget, this)); }, // Adds text field to target record. diff --git a/template/app/view/comments/Users.js b/template/app/view/comments/Users.js index 791ecae4e31e766ebeab2a835a4593b611a21750..fee1684d91dc36c5fe7d1fff73a32e28b24e8df7 100644 --- a/template/app/view/comments/Users.js +++ b/template/app/view/comments/Users.js @@ -137,7 +137,7 @@ Ext.define('Docs.view.comments.Users', { }, loadUsers: function(users) { - this.list.getStore().loadData(users); + this.list.getStore().loadData(users.data); if (this.selectedUser) { var index = this.list.getStore().findExact("userName", this.selectedUser.get("userName")); this.list.getSelectionModel().select(index, false, true);