Images for NotConserved

This commit is contained in:
2025-04-28 12:36:42 +02:00
parent f573b4deca
commit 68854f875b
4 changed files with 48 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Controller;
use App\Entity\NotConserved;
use App\Entity\Bibliography;
use App\Entity\Image;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -49,6 +50,13 @@ class NotConservedController extends AbstractController
$notConserved->setLat($coordinates['lat']);
$notConserved->setLng($coordinates['lng']);
$repo = $em->getRepository(Image::class);
$images = $repo->findBy(
['notConserved' => $notConserved->getId()],
['sequence' => 'ASC']
);
$notConserved->setImages($images);
return $this->json(
$notConserved,