fix: address code review issues

- Rename `read` column to `is_read` (PostgreSQL reserved word)
- Wrap navbar + modal in parent div for Stimulus controller scope
- Set temporary filePath before first flush in ImportController
- Use RETURNING clause for atomic incrementProcessedBatches
- Return proper empty 204 response in NotificationController

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-29 10:27:57 +02:00
parent b0024bbcf5
commit 6edc122ff6
6 changed files with 9 additions and 11 deletions

View File

@@ -46,6 +46,7 @@ class ImportController extends AbstractController
$import = new Import();
$import->setUser($user);
$import->setFilePath('pending');
$em->persist($import);
$em->flush();

View File

@@ -37,13 +37,13 @@ class NotificationController extends AbstractController
#[Route('/api/notifications/read', methods: ['POST'])]
#[IsGranted('ROLE_USER')]
public function markRead(NotificationRepository $notificationRepository): JsonResponse
public function markRead(NotificationRepository $notificationRepository): Response
{
/** @var User $user */
$user = $this->getUser();
$notificationRepository->markAllReadForUser($user);
return $this->json(null, Response::HTTP_NO_CONTENT);
return new Response('', Response::HTTP_NO_CONTENT);
}
}