diff options
| author | winter | 2024-12-23 22:26:46 +0000 |
|---|---|---|
| committer | winter | 2024-12-23 22:26:46 +0000 |
| commit | aafbcc8fc1a07872fffa4d669117f41148e509a8 (patch) | |
| tree | 0db483fc6883be0049590f612be8de9b025d2ab7 /routes/actor.php | |
| parent | 916d4521cb595493bc5df8b7f9ef52310b6d013a (diff) | |
rename "user" to actor and "post" to note everywhere
Diffstat (limited to 'routes/actor.php')
| -rw-r--r-- | routes/actor.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/routes/actor.php b/routes/actor.php index 8ebf1e2..d453a11 100644 --- a/routes/actor.php +++ b/routes/actor.php @@ -7,18 +7,18 @@ use Digitigrade\Model\Actor; use Digitigrade\Model\Note; use Digitigrade\Router; -Router::getInstance()->mount('/user/:handle', function (array $args) { +Router::getInstance()->mount('/actor/:handle', function (array $args) { $actor = Actor::findLocalByHandle($args['handle']); if ($actor == null || $actor->deleted) { - throw new NotFound("i don't know any local user called " . $args['handle']); + throw new NotFound("i don't know any local actor called " . $args['handle']); } if (isset($_SERVER['HTTP_ACCEPT']) && str_contains($_SERVER['HTTP_ACCEPT'], 'text/html')) { - throw new TemporaryRedirect(path_to_uri("/@/$actor->handle")); + throw new TemporaryRedirect("/@/$actor->handle"); } json_response($actor); }); -Router::getInstance()->mount('/user/:handle/basicFeed', function (array $args) { +Router::getInstance()->mount('/actor/:handle/basicFeed', function (array $args) { $actor = Actor::findLocalByHandle($args['handle']); $notes = Note::findAllWithAuthor($actor); // TODO: implement pagination @@ -33,7 +33,7 @@ Router::getInstance()->mount('/user/:handle/basicFeed', function (array $args) { ]); }); -Router::getInstance()->mount('/user/:handle/fullFeed', function (array $args) { +Router::getInstance()->mount('/actor/:handle/fullFeed', function (array $args) { $actor = Actor::findLocalByHandle($args['handle']); $notes = Note::findAllWithAuthor($actor); // TODO: implement pagination here as well @@ -46,7 +46,7 @@ Router::getInstance()->mount('/user/:handle/fullFeed', function (array $args) { ]); }); -Router::getInstance()->mount('/user/:handle/follow', function (array $args) { +Router::getInstance()->mount('/actor/:handle/follow', function (array $args) { $target = Actor::findLocalByHandle($args['handle']); if ($target == null) { throw new NotFound(); @@ -58,7 +58,7 @@ Router::getInstance()->mount('/user/:handle/follow', function (array $args) { $initiator->follow($target); }); -Router::getInstance()->mount('/user/:handle/unfollow', function (array $args) { +Router::getInstance()->mount('/actor/:handle/unfollow', function (array $args) { $target = Actor::findLocalByHandle($args['handle']); if ($target == null) { throw new NotFound(); @@ -70,7 +70,7 @@ Router::getInstance()->mount('/user/:handle/unfollow', function (array $args) { $initiator->unfollow($target); }); -Router::getInstance()->mount('/user/:handle/acceptedFollow', function (array $args) { +Router::getInstance()->mount('/actor/:handle/acceptedFollow', function (array $args) { $initiator = Actor::findLocalByHandle($args['handle']); if ($initiator == null) { throw new NotFound(); @@ -82,7 +82,7 @@ Router::getInstance()->mount('/user/:handle/acceptedFollow', function (array $ar $target->acceptPendingFollowFrom($initiator); }); -Router::getInstance()->mount('/user/:handle/rejectedFollow', function (array $args) { +Router::getInstance()->mount('/actor/:handle/rejectedFollow', function (array $args) { $initiator = Actor::findLocalByHandle($args['handle']); if ($initiator == null) { throw new NotFound(); |
