json-server
json-server copied to clipboard
A question about 'Relationships' usage(cascade save|update|delete operation).
request url is:
POST URL: {{json-server-url}}/posts?_embed=comments
request body is:
BODY :
[
{
"id": 999,
"title": "can json-server do cascade save?",
"author": "kiwipeach",
"comments": [
{
"id": 999,
"body": "can i be save?",
"postId": 1
}
]
}
]
result is
my question:
you can see i use ?_embed=comments
in my url,now the comments doesn't add to the comments section.what can i do if i want solve this problem?
Seems like alias "postId" works for "_expand" and "postsId" works for "_embed". It's pretty ugly!