Skip to content

Commit

Permalink
Merge pull request #470 from lazlojuly/testing-api-workflows-with-hooks
Browse files Browse the repository at this point in the history
Docs update of hook example code for replacing URL params
  • Loading branch information
honzajavorek committed May 5, 2016
2 parents 5a4e968 + 268e0a2 commit 11156f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ after('/cars > GET', function (transaction) {

//replace car ID in request for Car resource modification
before('/cars/{id} > PATCH', function (transaction) {
transaction.request.url = transaction.request.url.replace('42', stash['carId'])
transaction.fullPath = transaction.fullPath.replace('42', stash['carId'])
transaction.request.uri = transaction.fullPath
})
```

Expand Down

0 comments on commit 11156f7

Please sign in to comment.