Add a private per-user reaction resource: a manga_reactions table (one row per user+manga, like/dislike, cascades) and endpoints PUT/DELETE /mangas/:id/reaction plus GET /me/reactions/:manga_id, wired on the existing per-user seam (mirrors bookmarks/read_progress). Unknown manga → 404 via the FK-violation mapping; an invalid reaction value → 422. Reactions are never exposed publicly — this is a taste signal for the upcoming content-based recommendations. Integration tests cover set/toggle/clear/read, per-user isolation, and the 404/422/401 paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
38 lines
835 B
Rust
38 lines
835 B
Rust
pub mod admin;
|
|
pub mod auth;
|
|
pub mod authors;
|
|
pub mod bookmarks;
|
|
pub mod chapters;
|
|
pub mod collections;
|
|
pub mod files;
|
|
pub mod genres;
|
|
pub mod health;
|
|
pub mod history;
|
|
pub mod mangas;
|
|
pub mod page_tags;
|
|
pub mod pagination;
|
|
pub mod reactions;
|
|
pub mod tags;
|
|
|
|
use axum::Router;
|
|
|
|
use crate::app::AppState;
|
|
|
|
pub fn routes() -> Router<AppState> {
|
|
Router::new()
|
|
.merge(health::routes())
|
|
.merge(mangas::routes())
|
|
.merge(chapters::routes())
|
|
.merge(files::routes())
|
|
.merge(auth::routes())
|
|
.merge(bookmarks::routes())
|
|
.merge(genres::routes())
|
|
.merge(tags::routes())
|
|
.merge(authors::routes())
|
|
.merge(collections::routes())
|
|
.merge(page_tags::routes())
|
|
.merge(history::routes())
|
|
.merge(reactions::routes())
|
|
.merge(admin::routes())
|
|
}
|