Skip to content

feat: Add favorite heritages list API / お気に入り世界遺産一覧APIの追加 #565

Description

@zigzagdev

Motivation / 目的

Provide an API to list the World Heritage sites a user has favorited, reusing the Favorite domain/infra already implemented for the single add API (#550).

ログインユーザーがお気に入り登録した世界遺産の一覧を取得するAPIを提供する。単一お気に入り登録API(#550)で実装済みのFavoriteドメイン/インフラを再利用する。

Scope / スコープ

  • GET /api/v1/favorites — 認証済みユーザーのお気に入り世界遺産一覧(ページネーション付き)

API Request / Response

GET /api/v1/favorites

Request:

  • user_id: 認証済みユーザー(Authorization: Bearer <token> から解決。クライアントから明示的に渡すパラメータではない)
  • Query: current_page(default: 1), per_page(default: 30)— 既存の GET /v1/heritages と同じページネーション規約に合わせる

Response (200)、既存の PaginationDto::toArray() と同じ形(items + pagination)を踏襲する:

{
  "status": "success",
  "data": {
    "items": [ "..." ],
    "pagination": {
      "current_page": 1,
      "per_page": 30,
      "total": 42,
      "last_page": 2,
      "from": "1",
      "to": "30",
      "path": "...",
      "first_page_url": "...",
      "last_page_url": "...",
      "next_page_url": "...",
      "prev_page_url": "...",
      "links": []
    }
  }
}

Related / 関連

Sub-issues / サブIssue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions