Skip to content

Commit c81cd9f

Browse files
author
Vikas Agarwal
committed
Github issue#1240, SEO friendly URLs for deep links (without database and ES update)
— Fixed merge issue which was preventing to open the project details forms directly from the category page for categories which have only one product.
1 parent fa17a00 commit c81cd9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/projects/create/components/ProjectWizard.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,18 @@ class ProjectWizard extends Component {
107107
const updateQuery = {}
108108
if (params && params.product) { // if there exists product path param
109109
// first try the path param to be a project category
110-
let projectType = findCategory(params.product)
110+
let projectType = findCategory(params.product, true)
111111
if (projectType) {// if its a category
112112
updateQuery['type'] = { $set : projectType.id }
113113
wizardStep = WZ_STEP_SELECT_PROD_TYPE
114114
} else {
115115
// if it is not a category, it should be a product and we should be able to find a category for it
116-
projectType = findProductCategory(params.product)
116+
projectType = findProductCategory(params.product, true)
117+
// finds product object from product alias
118+
const product = findProduct(params.product, true)
117119
if (projectType) {// we can have `incomplete` as params.product
118120
updateQuery['type'] = { $set : projectType.id }
119-
updateQuery['details'] = { products : { $set: [params.product] } }
121+
updateQuery['details'] = { products : { $set: [product.id] } }
120122
wizardStep = WZ_STEP_FILL_PROJ_DETAILS
121123
}
122124
}

0 commit comments

Comments
 (0)