moved saving to UserPlayedPlace to seperate function
Some checks failed
default-pipeline default-pipeline #171

This commit is contained in:
Balázs Vigh 2021-05-06 10:05:23 +02:00
parent fb7c0e7a5c
commit 7143c7ec63

View File

@ -152,7 +152,16 @@ class GameFlowController
$session->set('state', $state);
$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