Skip to content

Commit

Permalink
fix: deleting logic if webhook subscriber method was called for anoth…
Browse files Browse the repository at this point in the history
…er trigger event than booking_created
  • Loading branch information
adnanalicic committed Jul 13, 2022
1 parent e62a074 commit ca7e27b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ public ResponseEntity<String> 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
Expand Down

0 comments on commit ca7e27b

Please sign in to comment.