Skip to content

Commit 9ed27c0

Browse files
committed
fix: admin unrsvp remove from schedule
1 parent 287b240 commit 9ed27c0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

app/Services/Model/Imp/SummitRSVPService.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,10 @@ public function delete(SummitEvent $event, int $rsvp_id): void
458458
$rsvp = $event->getRSVPById($rsvp_id);
459459
if (is_null($rsvp))
460460
throw new EntityNotFoundException("RSVP not found.");
461-
461+
$event = $rsvp->getEvent();
462+
$member = $rsvp->getOwner();
463+
if(!is_null($member) && !is_null($event) && $member->isOnSchedule($event))
464+
$member->removeFromSchedule($event);
462465
$this->rsvp_repository->delete($rsvp);
463466

464467
});
@@ -576,4 +579,4 @@ function ($root_entity_id) {
576579
}
577580
);
578581
}
579-
}
582+
}

0 commit comments

Comments
 (0)