diff --git a/src/resource.rs b/src/resource.rs index a25881b..2bbfafc 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -21,6 +21,13 @@ pub async fn get_resource( question_id: String, alternative: String, feature_name: String, + // An empty map serializes as no `params` key at all on a real + // client-side call (unlike the server-only initial SSR call, which + // never round-trips through serialization) - without this, every + // `Resource::refetch()` after a fully-empty-params call failed with + // "missing field `params`", even though the very first load (always + // server-resolved) never did. + #[server(default)] params: std::collections::HashMap, ) -> Result { use crate::server::AppState; @@ -48,6 +55,8 @@ pub async fn get_requirement_options( alternative: String, feature_name: String, requirement_name: String, + // See get_resource's `params` for why this is needed. + #[server(default)] params: std::collections::HashMap, ) -> Result { use crate::server::AppState;