feat: implement Infra layer for removing favorites / お気に入り解除のInfra層実装 - #572
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/user-favorite #572 +/- ##
========================================================
+ Coverage 64.28% 64.38% +0.09%
- Complexity 1677 1682 +5
========================================================
Files 145 145
Lines 8753 8776 +23
========================================================
+ Hits 5627 5650 +23
Misses 3126 3126
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 目的
Add the Infra-layer piece needed to remove a favorite: a way to detach a world heritage site from a user's favorites. This is a shared dependency for both the favorites list screen (removing a card) and, later, the toggle heart button on the top/search/detail pages.
お気に入り解除に必要なInfra層の実装です。お気に入り一覧画面でのカード削除と、将来のトグルハートボタン(トップ/検索/詳細ページ)の両方から使われる共通の土台になります。
What I have done / 実施内容
FavoriteRepositoryInterface::removeFavorite(int $userId, int $worldHeritageSiteId): voidFavoriteRepositoryusing$user->favorites()->detach()Exception('User not found.')asaddFavoritewhen the user does not existTest Results / テスト結果