fix: server functions with `url` as argument name (closes issue #823) (#825)

This commit is contained in:
Greg Johnston 2023-04-07 09:28:31 -04:00 committed by GitHub
parent ff5ceddbe2
commit 1187a506dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

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
}
})
}