fixing erros

This commit is contained in:
Priec
2026-08-15 15:29:15 +02:00
parent fe3848c453
commit fa9ee23538
5 changed files with 21 additions and 1 deletions

View File

@@ -529,7 +529,18 @@ pub(crate) async fn copy_profile(
let request = CopyProfileRequest {
source_profile_name: form.profile.clone(),
target_profile_name: form.target_profile_name.trim().to_string(),
table_names: form.table_names.clone(),
// No table selected means the whole profile, which is what the hint
// promises and what the server does with an empty list. A browser
// sends no `table_names` key at all when nothing is ticked; anything
// posting the field empty would otherwise send one blank name, and
// the server rejects a blank name rather than reading it as "all".
table_names: form
.table_names
.iter()
.map(|name| name.trim())
.filter(|name| !name.is_empty())
.map(str::to_string)
.collect(),
};
let Ok(request) = authenticated_request(&headers, request) else {
return Redirect::to("/login").into_response();