bug en update_player detectado

This commit is contained in:
serxoz 2022-09-15 17:25:55 +02:00
parent 2be6c80cbe
commit 950e74401e
2 changed files with 2 additions and 1 deletions

View File

@ -1 +1 @@
- Revisar instanciado dos xogadores. Durante as probas do combate pareceume que non se instanciaban ben cando se usaba un xogador que xa existía.
- Revisar update_player. Machaca tódolos rows da bbdd.

View File

@ -29,6 +29,7 @@ pub fn update_player(newplayer: &Player) -> Result<usize, diesel::result::Error>
use crate::schema::player;
let conn = &mut establish_connection();
// FIXME: actualiza todos os rows...
diesel::update(player::table)
.set(newplayer) // co trait AsChangeSet podese actualizar a struct enteira
.execute(conn)