Skip to content

feat: implement Presentation layer for DELETE /api/v1/favorites/{world_heritage_id} / お気に入り解除のPresentation層実装 - #576

Merged
zigzagdev merged 2 commits into
feat/user-favoritefrom
feat/user-favorite-remove-presentation
Aug 16, 2026
Merged

feat: implement Presentation layer for DELETE /api/v1/favorites/{world_heritage_id} / お気に入り解除のPresentation層実装#576
zigzagdev merged 2 commits into
feat/user-favoritefrom
feat/user-favorite-remove-presentation

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation / 目的

Expose RemoveFavoriteUseCase through a REST endpoint so the frontend can remove a favorite, both from the favorites list screen and, later, from the toggle heart button on the top/search/detail pages.

RemoveFavoriteUseCase をREST APIとして公開します。お気に入り一覧画面の削除、および将来のトグルハートボタンの両方から使われます。

What I have done / 実施内容

  • Added DELETE /api/v1/favorites/{world_heritage_id} route
  • Added FavoriteController::removeFavorite, returning 200 { "status": "success" } on success (matching addFavorite's response shape), 404 when the user is not found, 401 when unauthenticated

Test Results / テスト結果

  • test_removeFavorite_returns_200_and_removes_favorite_when_authenticated
  • test_removeFavorite_returns_200_when_not_favorited
  • test_removeFavorite_returns_401_when_unauthenticated
  • test_removeFavorite_returns_500_on_unexpected_error

@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.66%. Comparing base (7f1caa6) to head (4527c4e).
⚠️ Report is 2 commits behind head on feat/user-favorite.

Files with missing lines Patch % Lines
...ackages/Features/Controller/FavoriteController.php 80.95% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##             feat/user-favorite     #576      +/-   ##
========================================================
+ Coverage                 64.46%   64.66%   +0.19%     
- Complexity                 1687     1694       +7     
========================================================
  Files                       147      147              
  Lines                      8798     8858      +60     
========================================================
+ Hits                       5672     5728      +56     
- Misses                     3126     3130       +4     
Files with missing lines Coverage Δ
...Packages/Features/Tests/FavoriteControllerTest.php 99.31% <100.00%> (+0.24%) ⬆️
...ackages/Features/Controller/FavoriteController.php 85.96% <80.95%> (-2.93%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zigzagdev zigzagdev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@zigzagdev
zigzagdev merged commit cf39eb3 into feat/user-favorite Aug 16, 2026
28 checks passed
@zigzagdev
zigzagdev deleted the feat/user-favorite-remove-presentation branch August 16, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirm favorites API endpoint paths (add/list/remove) — frontend and issue docs disagree

1 participant