Skip to content

Commit

Permalink
Fix commenting client request
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Nov 27, 2023
1 parent 08d439f commit 267fbc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/ClientRequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public function clientComment(
{
$form = $this->createForm(ClientRequesCommentType::class);
$form->handleRequest($request);
$clientRequest = $clientRequestRepository->findOneBy(['token' => $request->get('token')]);

if ($form->isSubmitted() && $form->isValid()) {
$clientRequest = $clientRequestRepository->findOneBy(['token' => $request->get('token')]);
$clientRequestService->newComment($clientRequest, $form->getData()['comment'], $clientRequest->getName(), 0);
$snack = $this->translator->trans(id: 'save.comment', domain: 'general');
} else {
$snack = null;
}

return $this->redirectToRoute('client_show', ['slug' => $team->getSlug(), 'token' => $clientRequest->getToken(), 'snack' => $snack]);
}

Expand Down

0 comments on commit 267fbc8

Please sign in to comment.