From f005a056b7db295eaeac29e774b0c3261d064f32 Mon Sep 17 00:00:00 2001 From: serxoz Date: Thu, 15 Sep 2022 20:53:52 +0200 Subject: [PATCH] fix: player update - revisar --- src/player.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/player.rs b/src/player.rs index 28f8456..08076fd 100644 --- a/src/player.rs +++ b/src/player.rs @@ -26,11 +26,11 @@ pub fn create_player(newplayer: &Player) -> Result // update_player actualiza o xogador pub fn update_player(newplayer: &Player) -> Result { - use crate::schema::player; + use crate::schema::player::dsl::*; // para ter o find no update let conn = &mut establish_connection(); // FIXME: actualiza todos os rows... - diesel::update(player::table) + diesel::update(player::find(player, &newplayer.tag)) .set(newplayer) // co trait AsChangeSet podese actualizar a struct enteira .execute(conn) }