Roberto Sánchez
2014-01-23 cbfe9207ad7c9bba96b39c550d250d12097fd06f
securis/src/main/java/net/curisit/securis/services/PackResource.java
....@@ -101,7 +101,7 @@
101101 @Securable
102102 @Produces(
103103 { MediaType.APPLICATION_JSON })
104
- public Response get(@PathParam("packId") String packId, @Context BasicSecurityContext bsc) {
104
+ public Response get(@PathParam("packId") Integer packId, @Context BasicSecurityContext bsc) {
105105 log.info("Getting pack data for id: {}: ", packId);
106106 if (packId == null || packId.equals("")) {
107107 log.error("Pack ID is mandatory");
....@@ -109,7 +109,7 @@
109109 }
110110
111111 EntityManager em = emProvider.get();
112
- Pack pack = em.find(Pack.class, Integer.parseInt(packId));
112
+ Pack pack = em.find(Pack.class, packId);
113113 if (pack == null) {
114114 log.error("Pack with id {} not found in DB", packId);
115115 return Response.status(Status.NOT_FOUND).build();
....@@ -171,10 +171,10 @@
171171 @Consumes(MediaType.APPLICATION_JSON)
172172 @Produces(
173173 { MediaType.APPLICATION_JSON })
174
- public Response modify(Pack pack, @PathParam("packId") String packId) {
174
+ public Response modify(Pack pack, @PathParam("packId") Integer packId) {
175175 log.info("Modifying pack with id: {}", packId);
176176 EntityManager em = emProvider.get();
177
- Pack currentPack = em.find(Pack.class, Integer.parseInt(packId));
177
+ Pack currentPack = em.find(Pack.class, packId);
178178
179179 Organization org = null;
180180 if (pack.getOrgId() != null) {