Fix: test; limit changes on player update
This commit is contained in:
		| @@ -48,8 +48,8 @@ func (p *RepoProvider) PlayerAdd(ctx context.Context, player *models.Player) err | ||||
|  | ||||
| func (p *RepoProvider) PlayerUpdate(ctx context.Context, player *models.Player) error { | ||||
| 	db := getDB(ctx, p.DB) | ||||
| 	_, err := db.ExecContext(ctx, "UPDATE players SET room_id = ?, username = ?, team = ?, role = ?, is_bot = ? WHERE id = ?", | ||||
| 		player.RoomID, player.Username, player.Team, player.Role, player.IsBot, player.ID) | ||||
| 	_, err := db.ExecContext(ctx, "UPDATE players SET team = ?, role = ? WHERE username = ?", | ||||
| 		player.Team, player.Role, player.Username) | ||||
| 	return err | ||||
| } | ||||
|  | ||||
| @@ -67,7 +67,7 @@ func (p *RepoProvider) PlayerSetRoomID(ctx context.Context, username, roomID str | ||||
|  | ||||
| func (p *RepoProvider) PlayerExitRoom(ctx context.Context, username string) error { | ||||
| 	db := getDB(ctx, p.DB) | ||||
| 	_, err := db.ExecContext(ctx, "UPDATE players SET room_id='', team='', role='' WHERE username = ?", username) | ||||
| 	_, err := db.ExecContext(ctx, "UPDATE players SET room_id=null, team='', role='' WHERE username = ?", username) | ||||
| 	return err | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder