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 5e1cf3c commit 2a51e91
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController;


Expand Down Expand Up @@ -67,13 +68,14 @@ public ResponseEntity<MeetingSlug> getAskerMeetingSlug(String askerId) {
}

@Override
@Transactional
public ResponseEntity<String> processBooking(CalcomWebhook calcomWebhook) {
try {
CalcomWebhookPayload payload = calcomWebhook.getPayload();
Long bookingId = null;
if (payload != null) {
bookingId = Long.valueOf(payload.getBookingId());
if (calcomWebhook.getTriggerEvent().equals("BOOKING_CREATED")) {
bookingId = Long.valueOf(payload.getBookingId());
String askerId = payload.getMetadata().getUser();
CalcomBookingToAsker userAssociation = new CalcomBookingToAsker(bookingId, askerId);

Expand Down

0 comments on commit 2a51e91

Please sign in to comment.