Open pchabros opened 4 months ago
This does not work for me. Returns Not found. I use version ^1.0.0-beta.0.
Not found
^1.0.0-beta.0
For nested resources to work, you need to structure your db.json this way:
db.json
{ "environments": [ { "id": 12 }, { "id": 19 } ], "reports": [ { "id": 17, "environmentId": 12 }, { "id": 25, "environmentId": 12 } ] }
Then /environments/12/reports should return reports that have environmentId === 12
/environments/12/reports
environmentId === 12
Originally posted by @typicode in https://github.com/typicode/json-server/issues/72#issuecomment-99162206
Same issue for me: https://github.com/typicode/json-server/issues/1567
Did you get over this somehow? What runtime are you using? npm/bun/deno?
This does not work for me. Returns
Not found
. I use version^1.0.0-beta.0
.For nested resources to work, you need to structure your
db.json
this way:Then
/environments/12/reports
should return reports that haveenvironmentId === 12
Originally posted by @typicode in https://github.com/typicode/json-server/issues/72#issuecomment-99162206