refactor: move AddTorrentRequest to shared library for type safety
All checks were successful
Build MIPS Binary / build (push) Successful in 4m28s

This commit is contained in:
spinline
2026-02-08 22:43:35 +03:00
parent f2dfa7963e
commit 129a4c7586
4 changed files with 12 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
use leptos::*;
use leptos::html::Dialog;
use crate::store::{show_toast_with_signal, TorrentStore};
use shared::NotificationLevel;
use shared::{AddTorrentRequest, NotificationLevel};
#[component]
@@ -36,9 +36,7 @@ pub fn AddTorrentModal(
set_error_msg.set(None);
spawn_local(async move {
let req_body = serde_json::json!({
"uri": uri_val
});
let req_body = AddTorrentRequest { uri: uri_val };
match gloo_net::http::Request::post("/api/torrents/add")
.json(&req_body)