mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-17 16:40:31 +00:00
✨ Add addToMine functionality to Meetups API for adding meetups to a user's "My Meetups" list
- 🔒 Introduce `addToMine` policy for authenticated users to add existing meetups. - ✏️ Add `addToMine` method in `MeetupController` with idempotent handling. - ✨ Include `addMember` utility in `Meetup` model for managing pivot relationships. - 🛠️ Refactor `AddMeetupToMineTool` to use `addMember` for consistency. - 🧪 Add feature tests for `addToMine`, covering idempotency, permissions, and unknown slugs. - 🌐 Register `addToMine` route in API and link it to `MeetupController`.
This commit is contained in:
@@ -36,6 +36,17 @@ class MeetupPolicy
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ein bestehendes Meetup zu „Meine Meetups" hinzufügen (meetup_user-Pivot als
|
||||
* Mitglied, nicht als Leader). Jeder authentifizierte Nutzer darf das — die
|
||||
* Stammdaten bleiben dem Ersteller vorbehalten (siehe update()). Spiegelt die
|
||||
* offene Semantik des AddMeetupToMineTool (MCP).
|
||||
*/
|
||||
public function addToMine(User $user, Meetup $meetup): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update(User $user, Meetup $meetup): bool
|
||||
{
|
||||
return $this->owns($user, $meetup);
|
||||
|
||||
Reference in New Issue
Block a user