You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a simple frontend for Part-DB.
Unfortunately, I'm struggling to reduce parts from a lot.
The API documentation contains the endpoint /api/parts/{id}, which represents access to a part.
To decrease the part with ID 137, I use, for example, a
PATCH to /api/parts/137 with the JSON body { "partLots": [ { "@id": "/api/part_lots/122", "@type": "PartLot", "amount": 4, "id": 122 } ] }
Unfortunately, that doesn't work. The result is { "@id": "/api/errors/400", "@type": "hydra:Error", "title": "An error occurred", "detail": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "status": 400, "type": "/errors/400", "description": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "hydra:description": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "hydra:title": "An error occurred" }
So, how do I decrease or increase a part in a lot using the API?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a simple frontend for Part-DB.
Unfortunately, I'm struggling to reduce parts from a lot.
The API documentation contains the endpoint /api/parts/{id}, which represents access to a part.
To decrease the part with ID 137, I use, for example, a
PATCH to /api/parts/137 with the JSON body
{ "partLots": [ { "@id": "/api/part_lots/122", "@type": "PartLot", "amount": 4, "id": 122 } ] }
Unfortunately, that doesn't work. The result is
{ "@id": "/api/errors/400", "@type": "hydra:Error", "title": "An error occurred", "detail": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "status": 400, "type": "/errors/400", "description": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "hydra:description": "Nested documents for attribute \"partLots\" are not allowed. Use IRIs instead.", "hydra:title": "An error occurred" }
So, how do I decrease or increase a part in a lot using the API?
Best regards,
Michael
Beta Was this translation helpful? Give feedback.
All reactions