mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 15:33:52 +01:00
Multipart form UI and fixes
This commit is contained in:
@@ -196,9 +196,9 @@ async fn send_request(
|
||||
let pool2 = pool.clone();
|
||||
|
||||
tokio::spawn(async move {
|
||||
actually_send_request(req, &response2, &environment_id2, &app_handle2, &pool2)
|
||||
.await
|
||||
.expect("Failed to send request");
|
||||
if let Err(e) = actually_send_request(req, &response2, &environment_id2, &app_handle2, &pool2).await {
|
||||
response_err(&response2, e, &app_handle2, &pool2).await.expect("Failed to update response");
|
||||
}
|
||||
});
|
||||
|
||||
emit_and_return(&window, "created_model", response)
|
||||
|
||||
@@ -160,7 +160,7 @@ pub async fn actually_send_request(
|
||||
multipart_form = multipart_form.part(
|
||||
render::render(name, &workspace, environment_ref),
|
||||
match !file.is_empty() {
|
||||
true => multipart::Part::bytes(fs::read(file).expect("Failed to read file")),
|
||||
true => multipart::Part::bytes(fs::read(file).map_err(|e| e.to_string())?),
|
||||
false => multipart::Part::text(render::render(value, &workspace, environment_ref)),
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user