fix: address code review findings

- Guard against empty awardTypeIds array in AwardRepository
- Refactor Stimulus controller to use data-action attributes instead of
  imperative addEventListener (fixes duplicate listener issue)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-04-01 23:10:38 +02:00
parent b637b725d8
commit 51a9f49797
3 changed files with 17 additions and 19 deletions

View File

@@ -36,6 +36,10 @@ class AwardRepository extends ServiceEntityRepository
->andWhere('a.actor = :actorId')
->setParameter('actorId', $actorId);
if ($awardTypeIds !== null && empty($awardTypeIds)) {
return null;
}
if ($awardTypeIds !== null) {
$qb->andWhere('a.awardType IN (:typeIds)')
->setParameter('typeIds', $awardTypeIds);