feature/avoid-repeating-places-in-game #38
@ -152,7 +152,16 @@ class GameFlowController
|
||||
|
||||
$session->set('state', $state);
|
||||
|
||||
// save the selected place for the round in UserPlayedPlace
|
||||
$this->saveVisit($last);
|
||||
|
||||
return new JsonContent($response, $last);
|
||||
}
|
||||
|
||||
// save the selected place for the round in UserPlayedPlace
|
||||
private function saveVisit($last): void
|
||||
{
|
||||
$session = $this->request->session();
|
||||
|
||||
$userId = $session->get('userId');
|
||||
if(isset($userId)) {
|
||||
$placeId = $last['placeId'];
|
||||
@ -167,8 +176,6 @@ class GameFlowController
|
||||
$userPlayedPlace->setLastTimeDate(new DateTime());
|
||||
$this->pdm->saveToDb($userPlayedPlace);
|
||||
}
|
||||
|
||||
return new JsonContent($response);
|
||||
}
|
||||
|
||||
public function multiGuess(): IContent
|
||||
|
Loading…
Reference in New Issue
Block a user