Skip to content

Commit

Permalink
Prepare for ESL resp schema change (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai authored Dec 20, 2024
1 parent 3351497 commit 6ad3139
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions events/blocks/events-form/events-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,21 @@ function decorateSuccessScreen(screen) {
}

const { data } = resp;
const espStatus = data?.espProvider?.status;
const result = data?.espProvider || data;

if (!result) {
buildErrorMsg(screen, 500);
return;
}

const espStatus = result.status;

if ((espStatus && espStatus !== 204)) {
buildErrorMsg(screen, espStatus);
return;
}

if (data?.espProvider?.attendeeDeleted) BlockMediator.set('rsvpData', null);
if (result.attendeeDeleted) BlockMediator.set('rsvpData', null);

firstScreen.classList.add('hidden');
secondScreen.classList.remove('hidden');
Expand Down

0 comments on commit 6ad3139

Please sign in to comment.