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
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() {

View File

@ -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+$/)) {