feat: new endpoint to get all instances within a ji

This commit is contained in:
Arthur Wambst 2025-10-20 17:19:08 +02:00
parent 0aa72576ce
commit 2eab309cb2
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View File

@ -53,8 +53,7 @@ public class InstanceEndpoints {
@RolesAllowed("ROOT") @RolesAllowed("ROOT")
@Path("/{id}/all-instances") @Path("/{id}/all-instances")
public Response getAllInstancesJi(@PathParam("id") Long jiId) { public Response getAllInstancesJi(@PathParam("id") Long jiId) {
// TODO : a modif, la c est juste all instances return Response.ok(jiService.getAllInstancesJi(jiId)).build();
return Response.ok(instanceService.getAllInstances()).build();
} }
@GET @GET

View File

@ -48,6 +48,7 @@ public class JiService {
public Ji getJi(Long id) { return jiRepository.findById(id); } public Ji getJi(Long id) { return jiRepository.findById(id); }
public Long getJiSiteId(Long id) { return jiRepository.findById(id).site.id; } public Long getJiSiteId(Long id) { return jiRepository.findById(id).site.id; }
public List<Instance> getAllInstancesJi(Long jiId) { return jiRepository.findById(jiId).instances; }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

@ -1 +1 @@
Subproject commit 0a7e3fcc4479ec189128cb852b69f9b353e8fcd4 Subproject commit ddcb0920c54cbbc3c896fb735f97a9bc5f7e28f5