Explorar el Código

make files optional when deserializing form data

Evan Almloff hace 2 años
padre
commit
cfe94950c6
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      packages/html/src/events/form.rs

+ 5 - 1
packages/html/src/events/form.rs

@@ -14,7 +14,11 @@ pub struct FormData {
 
     #[cfg_attr(
         feature = "serialize",
-        serde(skip_serializing, deserialize_with = "deserialize_file_engine")
+        serde(
+            default,
+            skip_serializing,
+            deserialize_with = "deserialize_file_engine"
+        )
     )]
     pub files: Option<std::sync::Arc<dyn FileEngine>>,
 }