Add endpoints for tags

This commit is contained in:
Tobias Reisinger 2023-11-30 03:24:13 +01:00
parent c8f40284ef
commit 8d996888bd
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
10 changed files with 141 additions and 18 deletions
emgauwa-lib/src/db

View file

@ -108,18 +108,10 @@ impl DbRelay {
&self,
conn: &mut PoolConnection<Sqlite>,
new_name: &str,
new_number: i64,
new_controller: &DbController,
) -> Result<DbRelay, DatabaseError> {
sqlx::query!(
"UPDATE relays SET name = ?, number = ?, controller_id = ? WHERE id = ?",
new_name,
new_number,
new_controller.id,
self.id,
)
.execute(conn.deref_mut())
.await?;
sqlx::query!("UPDATE relays SET name = ? WHERE id = ?", new_name, self.id,)
.execute(conn.deref_mut())
.await?;
DbRelay::get(conn, self.id)
.await?