Enha: remove bot without room
This commit is contained in:
		| @@ -12,7 +12,7 @@ type PlayersRepo interface { | ||||
| 	PlayerGetByName(ctx context.Context, username string) (*models.Player, error) | ||||
| 	PlayerAdd(ctx context.Context, player *models.Player) error | ||||
| 	PlayerUpdate(ctx context.Context, player *models.Player) error | ||||
| 	PlayerDelete(ctx context.Context, roomID, username string) error | ||||
| 	PlayerDelete(ctx context.Context, username string) error | ||||
| 	PlayerSetRoomID(ctx context.Context, roomID, username string) error | ||||
| 	PlayerExitRoom(ctx context.Context, username string) error | ||||
| 	PlayerListNames(ctx context.Context) ([]string, error) | ||||
| @@ -56,9 +56,9 @@ func (p *RepoProvider) PlayerUpdate(ctx context.Context, player *models.Player) | ||||
| 	return err | ||||
| } | ||||
|  | ||||
| func (p *RepoProvider) PlayerDelete(ctx context.Context, roomID, username string) error { | ||||
| func (p *RepoProvider) PlayerDelete(ctx context.Context, username string) error { | ||||
| 	db := getDB(ctx, p.DB) | ||||
| 	_, err := db.ExecContext(ctx, "DELETE FROM players WHERE room_id = ? AND username = ?", roomID, username) | ||||
| 	_, err := db.ExecContext(ctx, "DELETE FROM players WHERE username = ?", username) | ||||
| 	return err | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder