mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-17 04:30:31 +00:00
🎨 Add logo field to meetups API responses and fetch media relations for meetups
- ✏️ Updated `MeetupController` to include `with('media')` for meetups query. - 🖼️ Added `logo` to `MeetupResource` via `getFirstMediaUrl`. - 🧪 Extended feature tests to validate `logo` presence and type in API responses.
This commit is contained in:
@@ -115,6 +115,7 @@ class MeetupController extends Controller
|
||||
|
||||
$meetups = $request->user()
|
||||
->meetups()
|
||||
->with('media')
|
||||
->orderBy('name')
|
||||
->get();
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ class MeetupResource extends JsonResource
|
||||
'community' => $this->community,
|
||||
'visible_on_map' => $this->visible_on_map,
|
||||
'is_active' => $this->is_active,
|
||||
'logo' => $this->getFirstMediaUrl('logo', 'thumb'),
|
||||
'last_event_at' => $this->last_event_at,
|
||||
'created_by' => $this->created_by,
|
||||
'created_at' => $this->created_at,
|
||||
|
||||
@@ -87,6 +87,11 @@ it('returns the dashboard-selected meetups in mine index', function () {
|
||||
expect($ids)
|
||||
->toContain(...$selected->pluck('id')->all())
|
||||
->not->toContain($unselected->id);
|
||||
|
||||
collect($response->json('data'))->each(
|
||||
fn ($meetup) => expect($meetup)->toHaveKey('logo')
|
||||
->and($meetup['logo'])->toBeString()
|
||||
);
|
||||
});
|
||||
|
||||
it('lets a pivot member view in mine show', function () {
|
||||
|
||||
Reference in New Issue
Block a user