Skip to content

Issue 678 api v2 cases put#690

Merged
whikernel merged 20 commits intodevelopfrom
issue_678_api_v2_cases_put
Jan 20, 2025
Merged

Issue 678 api v2 cases put#690
whikernel merged 20 commits intodevelopfrom
issue_678_api_v2_cases_put

Conversation

@c8y3
Copy link
Contributor

@c8y3 c8y3 commented Jan 17, 2025

This PR adds endpoint PUT /api/v2/cases/{identifier} to update a case.

Other work done:

  • fixed /api/v2/cases/{case_identifier}/tasks/{task_identifier} to return 200 instead of 201 on success (added a test)
  • removed strict_slashes=False option to all endpoints that had it (we want to be strict) (added a test)
  • changed tuple into a single value for business method cases_create (tuple as return values are a code smell)
  • changed last bp into blueprint and some id into identifier (avoid abbreviations)
  • added several tests about the case update

Remark: I noticed one inconsistency between the cases endpoint. They return case objects, with field case_customer_id. However endpoints POST /api/v2/cases and PUT /api/v2/cases/{identifier} expect field case_customer. I tried to change everything to case_customer_id. But it was too difficult to do, without risking to break past behavior. Maybe we should create an issue to track this and correct later.

@c8y3 c8y3 requested a review from whikernel January 17, 2025 14:55
@whikernel whikernel merged commit 36649ba into develop Jan 20, 2025
5 checks passed
@whikernel whikernel deleted the issue_678_api_v2_cases_put branch January 20, 2025 08:12
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

Successfully merging this pull request may close these issues.

2 participants