Skip to content

Favorite Heritage API #550

Description

@zigzagdev

Motivation / 目的

Add favorite (bookmark) functionality for World Heritage sites, backed by a new intermediate table linking users and world_heritage_sites.

ユーザーが世界遺産をお気に入り登録できる機能を追加する。中間テーブルで usersworld_heritage_sites を紐付ける。

Scope / スコープ

  • Add a favorite (POST)
  • Remove a favorite (DELETE)
  • List my favorites (GET)

A dedicated "is this heritage favorited by me" check endpoint is intentionally out of scope for this issue — still under separate discussion.

「特定の世界遺産が自分のお気に入りかどうかを確認するAPI」は本Issueのスコープ外(別途壁打ち中)。

API Request / Response

POST /api/v1/users/me/favorites

Request body:

  • user_id: number — 対象ユーザーID
  • heritage_id: number — 対象の世界遺産ID
  • is_liked: boolean — true でお気に入り登録
  • timestamps: created_at / updated_at(サーバー側で自動設定、クライアントからは渡さない)

Response: 204 No Content

DELETE /api/v1/users/me/favorites/{heritageId}

Request body: なし(URLの heritageId のみで対象を特定)

Response: 204 No Content

Sub-issues / サブIssue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions