Add missing endpoint for Reuse...
This commit is contained in:
parent
eabb619d90
commit
f91d88e04c
@ -43,4 +43,30 @@ class ReuseController extends AbstractController
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/reuse/{id<\d+>}', name: 'app_reuse_record')]
|
||||||
|
public function record(Reuse $reuse, EntityManagerInterface $em): JsonResponse
|
||||||
|
{
|
||||||
|
$repo = $em->getRepository(Reuse::class);
|
||||||
|
$coordinates = $repo->coordinates($reuse->getId());
|
||||||
|
//$repo = $em->getRepository(Bibliography::class);
|
||||||
|
|
||||||
|
//$biblio = $repo->findAllByNotConserved($reuse->getId());
|
||||||
|
//$repo = $em->getRepository(Document::class);
|
||||||
|
//$documents = $repo->findByNotConserved($reuse->getId());
|
||||||
|
$reuse->setBibliography([]);
|
||||||
|
//$reuse->setDocuments($documents);
|
||||||
|
|
||||||
|
$reuse->setLat($coordinates['lat']);
|
||||||
|
$reuse->setLng($coordinates['lng']);
|
||||||
|
$repo = $em->getRepository(Image::class);
|
||||||
|
$images = $repo->findBy(
|
||||||
|
['reuse' => $reuse->getId()],
|
||||||
|
['sequence' => 'ASC']
|
||||||
|
);
|
||||||
|
|
||||||
|
$reuse->setImages($images);
|
||||||
|
|
||||||
|
return $this->json($reuse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user