-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested request without any ids #514
Comments
Hey @melnikovic Nested requests to access nested resources aren't supported. At least, not with this data structure. I would suggest flattening {
"select": {
"org": []
},
"orgs": [{
"id": "5601e1c0-317c-4af8-9731-a1863f677e85",
"name": "DummyOrg"
}],
"logout": {}
} https://github.com/typicode/json-server#add-custom-routes {
"/rest/user/": "/"
} Then you'll be able to access each resources GET /rest/user/select
GET /rest/user/orgs
GET /rest/user/orgs/:id
... |
Hello, {
"building": [
{
"id": "H",
"name": "Home"
}
],
"room": [
{
"id": "112",
"buildingId": "H",
"name": "112"
}
],
"funktion": [
{
"id": 1,
"roomId": "112",
"ga": "2/1/20",
"DPT": "DPT1",
"commit": "Hello"
}
]
}
it is possible to get a solution for this relation? Br |
@typicode Will you work on nested support in the future? |
Hey guys,
I just start using json-server and struggling with one thing. I want to have URL which are nested so e.g. to get user orgs, request would looks like:
/rest/user/orgs
and will return array of user orgsJson as above is throwing 404. So any idea what I am doing wrong?
The text was updated successfully, but these errors were encountered: