Skip to content
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

POST on Relationship return 204, but the database doesn't have any created relationship. #13

Closed
sharky98 opened this issue Apr 4, 2021 · 1 comment

Comments

@sharky98
Copy link

sharky98 commented Apr 4, 2021

I think I have experienced the something similar #1. Basically I have a many-to-many relationship between Item A and Item C. I create Item C and relation to existing Item A with jquery.ajax() (note that I am seeing the same behavior with Postman). Since there is no (documented?) way to assign many-to-many relationship at creation (there is no attribute with the ID relationship), the way I do it is I create the Item C first POST /api/c_item, then when it's successful, I create the relationship POST /api/c_item/{newlyCreatedId}/relationships/a_items. My posted data is in the following format.

{
data: [
    {
      type: "a_item",
      id: 1
    },
    {
      type: "a_item",
      id: 2
    }
  ]
}

You can see a replication of the issue in the linked repository below.

sharky98 added a commit to sharky98/flask-restless-ng-bugs that referenced this issue Apr 4, 2021
mrevutskyi added a commit that referenced this issue Apr 6, 2021
Remove now resolved TODO
@mrevutskyi
Copy link
Owner

Should be fixed in v1.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants