forked from typicode/json-server
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Threat the request param as integer closes typicode#925, closes typicode#396
- Loading branch information
Filippo Conti
committed
Mar 19, 2019
1 parent
93e4011
commit 5f495f0
Showing
4 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ module.exports = opts => { | |
// Rewrite URL (/:resource/:id/:nested -> /:nested) and request body | ||
function post(req, res, next) { | ||
const prop = pluralize.singular(req.params.resource) | ||
req.body[`${prop}${opts.foreignKeySuffix}`] = req.params.id | ||
req.body[`${prop}${opts.foreignKeySuffix}`] = parseInt(req.params.id) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
b4dnewz
Member
|
||
req.url = `/${req.params.nested}` | ||
next() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Great that you tackled this isssue!
You should: