Skip to content

Change PUT to PATCH method for contacts#update action#64

Open
piobeny wants to merge 1 commit intomainfrom
pb/fix-contacts-update-method
Open

Change PUT to PATCH method for contacts#update action#64
piobeny wants to merge 1 commit intomainfrom
pb/fix-contacts-update-method

Conversation

@piobeny
Copy link
Copy Markdown
Contributor

@piobeny piobeny commented Apr 13, 2026

Motivation

#63

Changes

  • Change PUT to PATCH method for contact#update action

How to test

  • Smoke test Contact update action

N/A

Summary by CodeRabbit

  • Refactor
    • Improved contact update request handling to use more appropriate HTTP standards for partial resource modifications.

@piobeny piobeny requested review from i7an and mklocek April 13, 2026 12:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0004c6d8-12c2-41ed-9965-cda84fd8d02d

📥 Commits

Reviewing files that changed from the base of the PR and between 788c164 and 6394ea6.

📒 Files selected for processing (2)
  • src/Api/General/Contact.php
  • tests/Api/General/ContactTest.php

📝 Walkthrough

Walkthrough

The updateContact() method in the Contact API class is modified to use HTTP PATCH requests instead of PUT requests for updating contacts by ID or email. The endpoint path and request payload remain unchanged. Corresponding test mocks and assertions are updated to reflect this HTTP method change.

Changes

Cohort / File(s) Summary
Contact API HTTP Method Update
src/Api/General/Contact.php
Changed updateContact() from httpPut() to httpPatch() for the same endpoint and payload structure.
Contact API Test Updates
tests/Api/General/ContactTest.php
Removed httpPut from mocked methods; updated three test cases (testUpdateContactById, testUpdateContactByEmail, testUpdateContactExcludesNullUnsubscribed) to expect httpPatch instead of httpPut.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Poem

🐰 A patch is better than a put, you see,
Updating contacts with finesse and glee,
Smaller steps for bigger gains,
PATCH it up through all the veins! 🩹

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: switching the HTTP method from PUT to PATCH for the contacts update action.
Description check ✅ Passed The description includes motivation (issue reference), main change, and testing instructions, but lacks detailed explanations and the images/GIFs section from the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pb/fix-contacts-update-method

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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