DEV: Rename dynamic segment to snake case to fit with Ember convention

This commit is contained in:
Daniel Waterworth 2019-11-28 11:34:40 +00:00
parent 0911a9202e
commit 6431daaa2e
2 changed files with 11 additions and 11 deletions

View File

@ -28,9 +28,9 @@ export default function() {
// top // top
this.route("top"); this.route("top");
this.route("topCategoryNone", { 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 // top by periods
Site.currentProp("periods").forEach(period => { Site.currentProp("periods").forEach(period => {
@ -41,10 +41,10 @@ export default function() {
this.route(top, { path: "/top/" + period }); this.route(top, { path: "/top/" + period });
this.route(top + "CategoryNone", { 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", { 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, { path: "/" + filter });
this.route(filter + "CategoryNone", { this.route(filter + "CategoryNone", {
path: "/c/*categorySlugPathWithID/none/l/" + filter path: "/c/*category_slug_path_with_id/none/l/" + filter
}); });
this.route(filter + "Category", { 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" }); this.route("categoryWithID", { path: "/c/:parentSlug/:slug/:id" });
// default filter for a category // default filter for a category
this.route("categoryNone", { path: "/c/*categorySlugPathWithID/none" }); this.route("categoryNone", { path: "/c/*category_slug_path_with_id/none" });
this.route("category", { path: "/c/*categorySlugPathWithID" }); this.route("category", { path: "/c/*category_slug_path_with_id" });
}); });
this.route("groups", { resetNamespace: true, path: "/g" }, function() { this.route("groups", { resetNamespace: true, path: "/g" }, function() {

View File

@ -17,8 +17,8 @@ export default (filterArg, params) => {
queryParams, queryParams,
serialize(modelParams) { serialize(modelParams) {
if (!modelParams.categorySlugPathWithID) { if (!modelParams.category_slug_path_with_id) {
modelParams.categorySlugPathWithID = [ modelParams.category_slug_path_with_id = [
modelParams.parentSlug, modelParams.parentSlug,
modelParams.slug, modelParams.slug,
modelParams.id modelParams.id
@ -33,7 +33,7 @@ export default (filterArg, params) => {
model(modelParams) { model(modelParams) {
modelParams = this.serialize(modelParams); modelParams = this.serialize(modelParams);
const parts = modelParams.categorySlugPathWithID.split("/"); const parts = modelParams.category_slug_path_with_id.split("/");
let category = null; let category = null;
if (parts.length > 0 && parts[parts.length - 1].match(/^\d+$/)) { if (parts.length > 0 && parts[parts.length - 1].match(/^\d+$/)) {