chore: fix last commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Andre Henriques 2023-07-09 21:08:53 +01:00
parent a2f407655e
commit 099261247e

View File

@ -88,6 +88,7 @@ fn get_conn(db: &State<DBPool>) -> Result<Conn, String> {
fn prepare_statement<'a>(conn: &'a Conn, stat: &str) -> Result<Statement<'a>, String> { fn prepare_statement<'a>(conn: &'a Conn, stat: &str) -> Result<Statement<'a>, String> {
let stmt = conn.prepare(stat); let stmt = conn.prepare(stat);
if stmt.is_err() || stmt.as_ref().ok().is_none() { if stmt.is_err() || stmt.as_ref().ok().is_none() {
println!("stmt: {}", stat);
return Err(get_error_message("Could not construct statetment")); return Err(get_error_message("Could not construct statetment"));
} }
let stmt: Statement<'a> = stmt.unwrap(); let stmt: Statement<'a> = stmt.unwrap();
@ -142,7 +143,7 @@ pub async fn get_configure(db: &State<DBPool>) -> String {
return get_error_message("Not yet configured"); return get_error_message("Not yet configured");
} }
let stmt = prepare_statement(&conn, "SELECT id ledcount directionX directionY directionZ tags from configuration;"); let stmt = prepare_statement(&conn, "SELECT id, ledcount, directionX, directionY, directionZ, tags from configuration;");
if let Err(e) = stmt { if let Err(e) = stmt {
return e; return e;
} }