json-server icon indicating copy to clipboard operation
json-server copied to clipboard

A question about 'Relationships' usage(cascade save|update|delete operation).

Open intellijboy opened this issue 5 years ago • 1 comments

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? image

intellijboy avatar Dec 23 '19 08:12 intellijboy

Seems like alias "postId" works for "_expand" and "postsId" works for "_embed". It's pretty ugly!

Guvidaletti avatar Sep 28 '22 02:09 Guvidaletti