refactor typ

This commit is contained in:
2026-06-04 23:12:32 +02:00
parent 5fb2b3666f
commit 581c8bee88
15 changed files with 46 additions and 55 deletions

View File

@@ -12,17 +12,16 @@ impl Repository {
) -> Result<model::Typ, Error> {
const QUERY: &str = r#"
UPDATE typen
SET geaendert_am = $2, typname = $3 WHERE id = $1
RETURNING id, erstellt_am, geaendert_am, typname;
SET typname = $2, geaendert_am = $3 WHERE id = $1
RETURNING id, typname, erstellt_am, geaendert_am;
"#;
let typ = sqlx::query_as::<_, model::Typ>(QUERY)
.bind(typ.id)
.bind(typ.geaendert_am)
.bind(&typ.typname)
.bind(typ.geaendert_am)
.fetch_one(db)
.await?;
// .map(model::Typ::from)?;
Ok(typ)
}