<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Module\Api\Mastodon\Tags;
-use Friendica\App\Router;
+use Friendica\Core\System;
+use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Module\BaseApi;
DI::mstdnError()->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);
+ System::jsonExit($hashtag->toArray());
}
}