diff --git a/crates/bl/src/fetch.rs b/crates/bl/src/fetch.rs index 7c25b25..0f0a576 100644 --- a/crates/bl/src/fetch.rs +++ b/crates/bl/src/fetch.rs @@ -1,7 +1,10 @@ use core_types::{PhotoGroup, PhotoThumbnailDisplayParams}; -use leptos::{server, ServerFnError}; +use leptos::{server, server_fn::codec::Json, ServerFnError}; -#[server] +#[server( + input = Json, + output = Json, +)] #[cfg_attr(feature = "ssr", tracing::instrument)] pub async fn fetch_user_owned_photo_groups( user_id: core_types::UserRecordId, @@ -43,7 +46,10 @@ pub async fn fetch_user_owned_photo_groups( }) } -#[server] +#[server( + input = Json, + output = Json, +)] #[cfg_attr(feature = "ssr", tracing::instrument)] pub async fn fetch_photo_group( photo_group_id: core_types::PhotoGroupRecordId, @@ -77,7 +83,10 @@ pub async fn fetch_photo_group( }) } -#[server] +#[server( + input = Json, + output = Json, +)] #[cfg_attr(feature = "ssr", tracing::instrument)] pub async fn fetch_user( user_id: core_types::UserRecordId, @@ -110,7 +119,10 @@ pub async fn fetch_user( }) } -#[server] +#[server( + input = Json, + output = Json, +)] #[cfg_attr(feature = "ssr", tracing::instrument)] pub async fn fetch_photo_thumbnail( photo_id: core_types::PhotoRecordId, diff --git a/crates/bl/src/qr_code.rs b/crates/bl/src/qr_code.rs index 9ae6e0b..1c4a4fc 100644 --- a/crates/bl/src/qr_code.rs +++ b/crates/bl/src/qr_code.rs @@ -1,4 +1,4 @@ -use leptos::{server, ServerFnError}; +use leptos::{server, server_fn::codec::Json, ServerFnError}; /// Generate a QR code from the given data. Returns base64 encoded PNG data. #[cfg(feature = "ssr")] @@ -21,7 +21,10 @@ pub fn generate_qr_code_inner(data: &str) -> color_eyre::eyre::Result { Ok(data) } -#[server] +#[server( + input = Json, + output = Json, +)] #[cfg_attr(feature = "ssr", tracing::instrument)] pub async fn generate_qr_code(data: String) -> Result { generate_qr_code_inner(&data).map_err(|e| {