From f0e008e7d48a9ec1c14e82e200f909d027c10dff Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Mon, 25 Sep 2023 19:00:22 +0500 Subject: [PATCH 1/2] fix!: fix course detail page url bug fix course detail page url as after creating a course, its detail page was not accessible and showing nothing. The course page was unavailable when the course run includes a dot, as a result it's url was mismatching and it is fixed by adding the trailing slash "/" to the url. Here's the link to the initial GitHub issue: https://github.com/openedx/wg-build-test-release/issues/301 --- ecommerce/static/js/models/course_model.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ecommerce/static/js/models/course_model.js b/ecommerce/static/js/models/course_model.js index feb173e5d4c..6a0e63f42ec 100644 --- a/ecommerce/static/js/models/course_model.js +++ b/ecommerce/static/js/models/course_model.js @@ -31,6 +31,9 @@ define([ return Backbone.RelationalModel.extend({ urlRoot: '/api/v2/courses/', + url: function() { + return Backbone.Model.prototype.url.call(this) + '/'; + }, defaults: { id: null, From 5b1fde308035e7616c18ca67ca0a2c019cf4aae9 Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Wed, 8 Nov 2023 15:06:41 +0500 Subject: [PATCH 2/2] docs!: add a comment --- ecommerce/static/js/models/course_model.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ecommerce/static/js/models/course_model.js b/ecommerce/static/js/models/course_model.js index 6a0e63f42ec..8b13259d6ff 100644 --- a/ecommerce/static/js/models/course_model.js +++ b/ecommerce/static/js/models/course_model.js @@ -31,6 +31,8 @@ define([ return Backbone.RelationalModel.extend({ urlRoot: '/api/v2/courses/', + // course detail page url was not matching because of missing trailing slash, + // with thi function, trailing slash will be added to match the url url: function() { return Backbone.Model.prototype.url.call(this) + '/'; },