mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-15 07:26:09 +00:00
Implement instant websocket room updates
This commit is contained in:
@@ -12,6 +12,10 @@ use Illuminate\Validation\ValidationException;
|
||||
|
||||
class VoteService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly RoomRealtimeStateService $realtimeState,
|
||||
) {}
|
||||
|
||||
public function submit(Room $room, Player $player, string $value): void
|
||||
{
|
||||
$stateVersion = DB::transaction(function () use ($room, $player, $value): int {
|
||||
@@ -52,6 +56,7 @@ class VoteService
|
||||
$room->id,
|
||||
$stateVersion,
|
||||
RoomStateChange::VoteChanged,
|
||||
$this->realtimeState->for($room),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user