diff --git a/src/main/java/com/vi/appointmentservice/controller/AskerController.java b/src/main/java/com/vi/appointmentservice/controller/AskerController.java index 67a5543..eb025bb 100644 --- a/src/main/java/com/vi/appointmentservice/controller/AskerController.java +++ b/src/main/java/com/vi/appointmentservice/controller/AskerController.java @@ -81,10 +81,9 @@ public ResponseEntity processBooking(CalcomWebhook calcomWebhook) { calcomBookingToAskerRepository.save(userAssociation); } else if(calcomWebhook.getTriggerEvent().equals("BOOKING_RESCHEDULED")){ String askerId = payload.getMetadata().getUser(); - CalcomBookingToAsker userAssociation = new CalcomBookingToAsker(bookingId, askerId); + CalcomBookingToAsker userAssociation = new CalcomBookingToAsker(Long.valueOf(payload.getBookingId()), askerId); calcomBookingToAskerRepository.save(userAssociation); - bookingId = payload.getMetadata().getBookingId(); - calcomBookingToAskerRepository.deleteByCalcomBookingId(bookingId); + calcomBookingToAskerRepository.deleteByCalcomBookingId(payload.getMetadata().getBookingId()); } else { //TODO: change this. we need to get booking id based on uuid or save it also in the relational // entity