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) }