From 910a622371089c6724341841c366af01953a3644 Mon Sep 17 00:00:00 2001 From: Wojciech Kocjan Date: Thu, 21 Mar 2013 16:24:05 +0100 Subject: [PATCH] topic and admin dashboard not retrieving data properly when using prefix --- app/assets/javascripts/admin/models/admin_dashboard.js | 4 ++-- app/assets/javascripts/discourse/models/topic.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/models/admin_dashboard.js b/app/assets/javascripts/admin/models/admin_dashboard.js index 7d134c2fc..453b9dd16 100644 --- a/app/assets/javascripts/admin/models/admin_dashboard.js +++ b/app/assets/javascripts/admin/models/admin_dashboard.js @@ -3,7 +3,7 @@ Discourse.AdminDashboard = Discourse.Model.extend({}); Discourse.AdminDashboard.reopenClass({ find: function() { var model = Discourse.AdminDashboard.create(); - return $.ajax("/admin/dashboard", { + return $.ajax(Discourse.getURL("/admin/dashboard"), { type: 'GET', dataType: 'json', success: function(json) { @@ -12,4 +12,4 @@ Discourse.AdminDashboard.reopenClass({ } }); } -}); \ No newline at end of file +}); diff --git a/app/assets/javascripts/discourse/models/topic.js b/app/assets/javascripts/discourse/models/topic.js index c49c336e9..68b9f145e 100644 --- a/app/assets/javascripts/discourse/models/topic.js +++ b/app/assets/javascripts/discourse/models/topic.js @@ -389,7 +389,7 @@ Discourse.Topic.reopenClass({ @returns A promise that will resolve to the topics **/ findSimilarTo: function(title, body) { - return $.ajax({url: "/topics/similar_to", data: {title: title, raw: body} }).then(function (results) { + return $.ajax({url: Discourse.getURL("/topics/similar_to"), data: {title: title, raw: body} }).then(function (results) { return results.map(function(topic) { return Discourse.Topic.create(topic) }); }); },