refactor: Phase E — types de réponses API standardisés + SVGs inline → Icon
E1 - API responses: - Crée responses.rs avec OkResponse, DeletedResponse, UpdatedResponse, RevokedResponse, UnlinkedResponse, StatusResponse (6 tests de sérialisation) - Remplace ~15 json!() inline par des types structurés dans books, libraries, tokens, users, handlers, anilist, metadata, download_detection, torrent_import - Signatures de retour des handlers typées (plus de serde_json::Value) E2 - SVGs → Icon component: - Ajoute icon "lock" au composant Icon - Remplace ~30 SVGs inline par <Icon> dans 9 composants (FolderPicker, FolderBrowser, LiveSearchForm, JobRow, LibraryActions, ReadingStatusModal, EditBookForm, EditSeriesForm, UserSwitcher) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -669,7 +669,7 @@ pub async fn get_thumbnail(
|
||||
pub async fn delete_book(
|
||||
State(state): State<AppState>,
|
||||
Path(id): Path<Uuid>,
|
||||
) -> Result<Json<serde_json::Value>, ApiError> {
|
||||
) -> Result<Json<crate::responses::OkResponse>, ApiError> {
|
||||
// Fetch the book and its file path
|
||||
let row = sqlx::query(
|
||||
"SELECT b.library_id, b.thumbnail_path, bf.abs_path \
|
||||
@@ -727,5 +727,5 @@ pub async fn delete_book(
|
||||
id, scan_job_id, library_id
|
||||
);
|
||||
|
||||
Ok(Json(serde_json::json!({ "ok": true })))
|
||||
Ok(Json(crate::responses::OkResponse::new()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user