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

Issue 678 api v2 cases put #690

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open

Issue 678 api v2 cases put #690

wants to merge 20 commits into from

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
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.

1 participant