mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Rename dynamic segment to snake case to fit with Ember convention
This commit is contained in:
parent
0911a9202e
commit
6431daaa2e
@ -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() {
|
||||
|
@ -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+$/)) {
|
||||
|
Loading…
Reference in New Issue
Block a user