X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModule%2FApi%2FMastodon%2FTags%2FUnfollow.php;h=07b93d95a2dedc8c2cf3a4feb752f5445f556235;hb=7486ebdc10715b7204b70ce262052d28cb61c69e;hp=a20b824b8d3547a2dfbe70a1e53eabbf21c1c50e;hpb=a6d060b0e4c7ce046211619eb6ae20492998af6d;p=friendica.git diff --git a/src/Module/Api/Mastodon/Tags/Unfollow.php b/src/Module/Api/Mastodon/Tags/Unfollow.php index a20b824b8d..07b93d95a2 100644 --- a/src/Module/Api/Mastodon/Tags/Unfollow.php +++ b/src/Module/Api/Mastodon/Tags/Unfollow.php @@ -1,6 +1,6 @@ checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); if (empty($this->parameters['hashtag'])) { - DI::mstdnError()->UnprocessableEntity(); + $this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity()); } - $this->response->unsupported(Router::POST, $request); + $term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')]; + + DBA::delete('search', $term); + + $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($this->parameters['hashtag'])], [], false); + $this->jsonExit($hashtag->toArray()); } }