Compare commits

...

2 Commits

Author SHA1 Message Date
Greg Johnston
89a4ab5fe7 cargo fmt 2023-04-07 08:16:10 -04:00
Greg Johnston
cb904c6f63 fix: server functions with url as argument name (closes issue #823) 2023-04-07 07:48:09 -04:00

View File

@@ -236,9 +236,15 @@ pub fn server_macro_impl(
#[cfg(not(feature = "ssr"))]
#[allow(unused_variables)]
#vis async fn #fn_name(#(#fn_args_2),*) #output_arrow #return_ty {
let prefix = #struct_name::prefix().to_string();
let url = prefix + "/" + #struct_name::url();
#server_fn_path::call_server_fn(&url, #struct_name { #(#field_names_5),* }, #encoding).await
#server_fn_path::call_server_fn(
&{
let prefix = #struct_name::prefix().to_string();
prefix + "/" + #struct_name::url()
},
#struct_name { #(#field_names_5),* },
#encoding
).await
}
})
}