summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
diff options
context:
space:
mode:
authorMar0xy <marie@kaifa.ch>2023-09-25 22:45:22 +0200
committerMar0xy <marie@kaifa.ch>2023-09-25 22:45:22 +0200
commit5ffcd278be9121f965b19a4e0b719ce3e45b7173 (patch)
treedc1ebd9338a646d82ac88a893185ceeb8aacc984 /packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
parentupd: use uploadMedia function (diff)
downloadsharkey-5ffcd278be9121f965b19a4e0b719ce3e45b7173.tar.gz
sharkey-5ffcd278be9121f965b19a4e0b719ce3e45b7173.tar.bz2
sharkey-5ffcd278be9121f965b19a4e0b719ce3e45b7173.zip
rm: remove attempt at supporting avatar/banner changing
Diffstat (limited to 'packages/backend/src/server/api/mastodon/MastodonApiServerService.ts')
-rw-r--r--packages/backend/src/server/api/mastodon/MastodonApiServerService.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
index adcbe6077f..f343e1b69d 100644
--- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
+++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
@@ -236,20 +236,14 @@ export class MastodonApiServerService {
}
});
- fastify.patch('/v1/accounts/update_credentials', { preHandler: upload.single('file') }, async (_request, reply) => {
+ fastify.patch('/v1/accounts/update_credentials', async (_request, reply) => {
const BASE_URL = `${_request.protocol}://${_request.hostname}`;
const accessTokens = _request.headers.authorization;
const client = getClient(BASE_URL, accessTokens); // we are using this here, because in private mode some info isnt
// displayed without being logged in
try {
- const multipartData = await _request.file;
- if (!multipartData) {
- const data = await client.updateCredentials(_request.body!);
- reply.send(convertAccount(data.data));
- } else {
- const data = await client.updateCredentials(_request.body!, multipartData);
- reply.send(convertAccount(data.data));
- }
+ const data = await client.updateCredentials(_request.body!);
+ reply.send(convertAccount(data.data));
} catch (e: any) {
/* console.error(e); */
reply.code(401).send(e.response.data);