From 6431daaa2ee7dee5104f65bf34c39127ff8be62d Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Thu, 28 Nov 2019 11:34:40 +0000 Subject: [PATCH] DEV: Rename dynamic segment to snake case to fit with Ember convention --- .../discourse/routes/app-route-map.js.es6 | 16 ++++++++-------- .../discourse/routes/build-category-route.js.es6 | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 index dc8cdf92f63..dfcbfef9b3d 100644 --- a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 +++ b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 @@ -28,9 +28,9 @@ export default function() { // top this.route("top"); this.route("topCategoryNone", { - path: "/c/*categorySlugPathWithID/none/l/top" + path: "/c/*category_slug_path_with_id/none/l/top" }); - this.route("topCategory", { path: "/c/*categorySlugPathWithID/l/top" }); + this.route("topCategory", { path: "/c/*category_slug_path_with_id/l/top" }); // top by periods Site.currentProp("periods").forEach(period => { @@ -41,10 +41,10 @@ export default function() { this.route(top, { path: "/top/" + period }); this.route(top + "CategoryNone", { - path: "/c/*categorySlugPathWithID/none/l/top/" + period + path: "/c/*category_slug_path_with_id/none/l/top/" + period }); this.route(top + "Category", { - path: "/c/*categorySlugPathWithID/l/top/" + period + path: "/c/*category_slug_path_with_id/l/top/" + period }); }); @@ -55,10 +55,10 @@ export default function() { this.route(filter, { path: "/" + filter }); this.route(filter + "CategoryNone", { - path: "/c/*categorySlugPathWithID/none/l/" + filter + path: "/c/*category_slug_path_with_id/none/l/" + filter }); this.route(filter + "Category", { - path: "/c/*categorySlugPathWithID/l/" + filter + path: "/c/*category_slug_path_with_id/l/" + filter }); }); @@ -69,8 +69,8 @@ export default function() { this.route("categoryWithID", { path: "/c/:parentSlug/:slug/:id" }); // default filter for a category - this.route("categoryNone", { path: "/c/*categorySlugPathWithID/none" }); - this.route("category", { path: "/c/*categorySlugPathWithID" }); + this.route("categoryNone", { path: "/c/*category_slug_path_with_id/none" }); + this.route("category", { path: "/c/*category_slug_path_with_id" }); }); this.route("groups", { resetNamespace: true, path: "/g" }, function() { diff --git a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 index c7cb74613c3..ca2a4765384 100644 --- a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 @@ -17,8 +17,8 @@ export default (filterArg, params) => { queryParams, serialize(modelParams) { - if (!modelParams.categorySlugPathWithID) { - modelParams.categorySlugPathWithID = [ + if (!modelParams.category_slug_path_with_id) { + modelParams.category_slug_path_with_id = [ modelParams.parentSlug, modelParams.slug, modelParams.id @@ -33,7 +33,7 @@ export default (filterArg, params) => { model(modelParams) { modelParams = this.serialize(modelParams); - const parts = modelParams.categorySlugPathWithID.split("/"); + const parts = modelParams.category_slug_path_with_id.split("/"); let category = null; if (parts.length > 0 && parts[parts.length - 1].match(/^\d+$/)) {