Skip to content

Commit 44e8d94

Browse files
committed
editoast: add error_layers when cloning an infra
1 parent 8ecea1c commit 44e8d94

File tree

1 file changed

+8
-0
lines changed
  • editoast/src/views/infra

1 file changed

+8
-0
lines changed

editoast/src/views/infra/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,15 @@ async fn clone(
316316
}
317317
}
318318

319+
// Add error layers
320+
let error_layer = sql_query(format!("INSERT INTO infra_layer_error(geographic, schematic, information, infra_id) SELECT geographic, schematic, information, $1 FROM infra_layer_error WHERE infra_id=$2"))
321+
.bind::<BigInt, _>(cloned_infra.id.unwrap())
322+
.bind::<BigInt, _>(infra)
323+
.execute(&mut conn);
324+
futures.push(error_layer);
325+
319326
let _res = try_join_all(futures).await?;
327+
320328
Ok(Json(cloned_infra.id.unwrap()))
321329
}
322330

0 commit comments

Comments
 (0)