refactor(meetup): re-add RsvpResponse
This commit is contained in:
parent
3350085e85
commit
ae0e0c2437
|
@ -23,7 +23,7 @@ final class MeetupEventRepository implements EventRepository
|
|||
$rsvps = json_decode($response->getContent());
|
||||
|
||||
return Collection::make($rsvps)
|
||||
->filter(fn (\stdClass $rsvp): bool => $rsvp->response == 'yes')
|
||||
->filter(fn (\stdClass $rsvp): bool => $rsvp->response == RsvpResponse::RESPONSE_YES)
|
||||
->filter(fn (\stdClass $attendee): bool => !$attendee->member->event_context->host)
|
||||
->map(function (\stdClass $attendee): \stdClass {
|
||||
$attendee->is_attending = true;
|
||||
|
|
11
src/Meetup/RsvpResponse.php
Normal file
11
src/Meetup/RsvpResponse.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Meetup;
|
||||
|
||||
final class RsvpResponse
|
||||
{
|
||||
public const RESPONSE_NO = 'no';
|
||||
public const RESPONSE_YES = 'yes';
|
||||
}
|
Loading…
Reference in a new issue