Closed wwdto closed 1 year ago
Additions:
The same happens, when updating project-status
We have a bunch of project without connection. Tried to create a workaround for data maintenance with adding the company_id in payload: ( see examples below )- which does not work.
So we have no idea how to fix these missing connection to company.id for more than 70 projects?
Payload-examples or updating a project:
2.Version: { "isbillable": true, "name": "99031013 - DTO1013_Test, ob Kunde verlinkt bleibt", "company".id": "68dd2010-1764-ed11-ade6-cc60c8b6713c" }
What happened?
API: companyid gets lost when updating name or status of a project
method: PUT endpoint: https://api.awork.io/api/v1/projects/f2e48562-b26c-4d65-9360-4c04c4d03fd9 payload: {"isbillable": true,"name": "99031013 - DTO1013_Test, ob Kunde verlinkt bleibt"}
Update_Project.1.2.mov
What is the trace id of the call?
trace-id: 650cbf77526b14247351232464e42d01
trace-id: 7c8de58060f8aedab16d319ab225c743
Update_project_postman.2.mov
Relevant error responses
No response
Hello @wwdto, it's crucial to understand the difference in how HTTP verbs such as PUT and POST behave. The PUT HTTP verb is idempotent and meant for complete replacement of a resource. Therefore, when you use PUT, it's expected that you provide all the fields of the resource.
Here's why: If you're using PUT and you don't provide a value for a particular field like CompanyId, the request assumes that you want to update the existing value to 'null'. That's because PUT is designed to replace the entire state of the identified resource with the state defined in the request body, not just modify some parts of it. We unfortunately do not support PATCH so you always need to get the whole entity and then send all fields which you received before.
Best regards
Nils
What happened?
API: companyid gets lost when updating name or status of a project
method: PUT endpoint: https://api.awork.io/api/v1/projects/f2e48562-b26c-4d65-9360-4c04c4d03fd9 payload: {"isbillable": true,"name": "99031013 - DTO1013_Test, ob Kunde verlinkt bleibt"}
https://github.com/awork-io/awork/assets/90595629/349f82ce-85af-4865-87ac-110246636411
What is the trace id of the call?
trace-id: 650cbf77526b14247351232464e42d01
trace-id: 7c8de58060f8aedab16d319ab225c743
https://github.com/awork-io/awork/assets/90595629/fc92e6c7-7f5f-4b2f-8928-2d5890e83a68
Relevant error responses
No response