From 63467e50501c6b54c35eb1418b4a7e1000c8e107 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Sun, 19 Sep 2021 19:45:19 +0200 Subject: [PATCH] server: Prevent user updates from applying to everyone --- server/src/domain/sql_backend_handler.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/domain/sql_backend_handler.rs b/server/src/domain/sql_backend_handler.rs index 26e7d89..72f7886 100644 --- a/server/src/domain/sql_backend_handler.rs +++ b/server/src/domain/sql_backend_handler.rs @@ -220,6 +220,7 @@ impl BackendHandler for SqlBackendHandler { let query = Query::update() .table(Users::Table) .values(values) + .and_where(Expr::col(Users::UserId).eq(request.user_id)) .to_string(DbQueryBuilder {}); sqlx::query(&query).execute(&self.sql_pool).await?; Ok(())