diff --git a/paseos-01-logic/src/main/java/co/edu/uniandes/csw/paseos/ejbs/OfertaLogic.java b/paseos-01-logic/src/main/java/co/edu/uniandes/csw/paseos/ejbs/OfertaLogic.java index f29ff27..9b65309 100644 --- a/paseos-01-logic/src/main/java/co/edu/uniandes/csw/paseos/ejbs/OfertaLogic.java +++ b/paseos-01-logic/src/main/java/co/edu/uniandes/csw/paseos/ejbs/OfertaLogic.java @@ -36,10 +36,10 @@ public OfertaEntity createOferta(OfertaEntity oferta)throws BusinessLogicExcepti throw new BusinessLogicException ("La oferta debe tener fecha y esta debe ser posterior a la fecha actual"); if(oferta.getInscritos() != 0) throw new BusinessLogicException ("El numero de inscritos no puede ser diferente de cero"); - if(Ppersistence.find(oferta.getPaseo().getId()) == null) - throw new BusinessLogicException ("El paseo no existe"); - if(Upersistence.find(oferta.getGuia().getId()) == null || !Upersistence.find(oferta.getGuia().getId()).getGuia()) - throw new BusinessLogicException ("El guía no existe"); + //if(Ppersistence.find(oferta.getPaseo().getId()) == null) + // throw new BusinessLogicException ("El paseo no existe"); + //if(Upersistence.find(oferta.getGuia().getId()) == null || !Upersistence.find(oferta.getGuia().getId()).getGuia()) + // throw new BusinessLogicException ("El guía no existe"); return Opersistence.create(oferta); } diff --git a/paseos-01-web/src/main/java/co/edu/uniandes/csw/paseos/resources/OfertaResource.java b/paseos-01-web/src/main/java/co/edu/uniandes/csw/paseos/resources/OfertaResource.java index 60fc0b6..30eb63c 100644 --- a/paseos-01-web/src/main/java/co/edu/uniandes/csw/paseos/resources/OfertaResource.java +++ b/paseos-01-web/src/main/java/co/edu/uniandes/csw/paseos/resources/OfertaResource.java @@ -64,7 +64,7 @@ public OfertaDetailDTO updateOferta(@PathParam("id") Long id, OfertaDetailDTO dt @DELETE @Path("{id: \\d+}") - public void deleteOferta(@PathParam("id") Long id) { + public void deleteOferta(@PathParam("id") Long id) throws BusinessLogicException{ ofertaLogic.deleteOferta(id); } }