APP als Hybrid Version - Anbindung an API
This commit is contained in:
parent
d054732bf5
commit
c1514999be
46 changed files with 3418 additions and 196 deletions
|
|
@ -18,7 +18,7 @@ class EventController extends Controller
|
|||
*/
|
||||
public function index(Request $request): AnonymousResourceCollection
|
||||
{
|
||||
$query = $request->user()->events()->orderBy('date');
|
||||
$query = $request->user()->events()->with('media')->orderBy('date');
|
||||
|
||||
// Delta sync: only events updated since a given timestamp
|
||||
if ($request->has('since')) {
|
||||
|
|
@ -50,7 +50,7 @@ class EventController extends Controller
|
|||
'note' => $request->validated('note'),
|
||||
]);
|
||||
|
||||
return (new EventResource($event))
|
||||
return (new EventResource($event->load('media')))
|
||||
->response()
|
||||
->setStatusCode(201);
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ class EventController extends Controller
|
|||
->where('client_id', $clientId)
|
||||
->firstOrFail();
|
||||
|
||||
return new EventResource($event);
|
||||
return new EventResource($event->load('media'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -103,7 +103,7 @@ class EventController extends Controller
|
|||
|
||||
$event->update($data);
|
||||
|
||||
return new EventResource($event->fresh());
|
||||
return new EventResource($event->fresh()->load('media'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue