From b1d6fbc4d740324d96d7fe2677fb15b9b59d20ea Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 16 Jan 2025 20:21:42 +0000 Subject: follow requests --- routes/actor_profile_fragment.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'routes/actor_profile_fragment.php') diff --git a/routes/actor_profile_fragment.php b/routes/actor_profile_fragment.php index 9b864d9..a3be976 100644 --- a/routes/actor_profile_fragment.php +++ b/routes/actor_profile_fragment.php @@ -20,4 +20,22 @@ Router::getInstance()->mount('/fragment/actor/:id/followButton', function (array } render_template('actor_profile_follow_button', ['user' => $user, 'actor' => $actor]); +}); + +Router::getInstance()->mount('/fragment/actor/:id/acceptPending', function (array $args) { + $user = UserAccount::requireByCurrentSession(); + $actor = Actor::find($args['id']); + + $user->actor->acceptPendingFollowFrom($actor); + + render_template('actor_profile_pending_follow', ['response' => 'accepted']); +}); + +Router::getInstance()->mount('/fragment/actor/:id/rejectPending', function (array $args) { + $user = UserAccount::requireByCurrentSession(); + $actor = Actor::find($args['id']); + + $user->actor->rejectPendingFollowFrom($actor); + + render_template('actor_profile_pending_follow', ['response' => 'rejected']); }); \ No newline at end of file -- cgit v1.3