Router Parameters - Merge Parameters


#1

project link: https://www.codecademy.com/programs/a69cb81af830c13c873cb401c07e39a0/content-items/729e5920fc7e4faba61716fc3b105307/exercises/merge-params

Part 3:

I believe there is a typo:
newSpice.spiceRackId equal to the req.params.spiceRackId should say instead:
newSpice.spiceRackId equal to the req.params.id

Or, I just don’t understand this section very well. It was kind of clunkily written and confusing…

If I understood correctly, this concept is similar to React’s inheritance structure. If that’s true, then taking the app.js info passed from the spiceRack object would requre us to reference the “id” parameter from the request if it’s getting passed into the spicesRouter.js correctly with the {mergedParams: true} setting determined in step 2.