From 78dab01696b21a62474962fe1beec48282ccaa3a Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 May 2021 12:13:03 +0000 Subject: [PATCH] "UpdateCredentials" dummy added (currently not working) --- .../Mastodon/Accounts/UpdateCredentials.php | 42 +++++++++++++++++++ static/routes.config.php | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/Module/Api/Mastodon/Accounts/UpdateCredentials.php diff --git a/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php b/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php new file mode 100644 index 000000000..30b190a33 --- /dev/null +++ b/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php @@ -0,0 +1,42 @@ +. + * + */ + +namespace Friendica\Module\Api\Mastodon\Accounts; + +use Friendica\Module\BaseApi; +use Friendica\Util\Network; + +/** + * @see https://docs.joinmastodon.org/methods/accounts/ + */ +class UpdateCredentials extends BaseApi +{ + public static function patch(array $parameters = []) + { + self::login(); + $uid = self::getCurrentUserID(); + + $data = Network::postdata(); + + // @todo Parse the raw data that is in the "multipart/form-data" format + self::unsupported('patch'); + } +} diff --git a/static/routes.config.php b/static/routes.config.php index 89256a9e6..ada9de8a5 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -76,7 +76,7 @@ return [ '/accounts/relationships' => [Module\Api\Mastodon\Accounts\Relationships::class, [R::GET ]], '/accounts/search' => [Module\Api\Mastodon\Accounts\Search::class, [R::GET ]], '/accounts/verify_credentials' => [Module\Api\Mastodon\Accounts\VerifyCredentials::class, [R::GET ]], - '/accounts/update_credentials' => [Module\Api\Mastodon\Unimplemented::class, [R::PATCH ]], // @todo + '/accounts/update_credentials' => [Module\Api\Mastodon\Accounts\UpdateCredentials::class, [R::PATCH ]], '/admin/accounts' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not supported '/admin/accounts/{id:\d+}' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not supported '/admin/accounts/{id:\d+}/{action}' => [Module\Api\Mastodon\Unimplemented::class, [ R::POST]], // not supported