mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
feat(routes): add media and logo to meetups API endpoint
This commit is contained in:
@@ -76,12 +76,13 @@ Route::middleware([])
|
|||||||
'image' => $item->getFirstMediaUrl('main'),
|
'image' => $item->getFirstMediaUrl('main'),
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
Route::get('meetups', function () {
|
Route::get('meetups', function (Request $request) {
|
||||||
return \App\Models\Meetup::query()
|
return \App\Models\Meetup::query()
|
||||||
->where('visible_on_map', true)
|
->where('visible_on_map', true)
|
||||||
->with([
|
->with([
|
||||||
'meetupEvents',
|
'meetupEvents',
|
||||||
'city.country',
|
'city.country',
|
||||||
|
'media',
|
||||||
])
|
])
|
||||||
->get()
|
->get()
|
||||||
->map(fn($meetup) => [
|
->map(fn($meetup) => [
|
||||||
@@ -100,6 +101,7 @@ Route::middleware([])
|
|||||||
'simplex' => $meetup->simplex,
|
'simplex' => $meetup->simplex,
|
||||||
'nostr' => $meetup->nostr,
|
'nostr' => $meetup->nostr,
|
||||||
'next_event' => $meetup->nextEvent,
|
'next_event' => $meetup->nextEvent,
|
||||||
|
'logo' => $request->has('withLogos') ? $meetup->getFirstMediaUrl('logo') : null,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
Route::get('meetup-events/{date?}', function ($date = null) {
|
Route::get('meetup-events/{date?}', function ($date = null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user