diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-11-16 19:45:54 +0100 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-11-16 19:45:54 +0100 |
| commit | 6ca27b48cfea09cae9f2b42d9300e720921fbbc7 (patch) | |
| tree | 1b4b9c5c114818e11d62889ea59a9c3790878925 /packages/backend/src | |
| parent | upd: style of buttons for user like setting (diff) | |
| download | sharkey-6ca27b48cfea09cae9f2b42d9300e720921fbbc7.tar.gz sharkey-6ca27b48cfea09cae9f2b42d9300e720921fbbc7.tar.bz2 sharkey-6ca27b48cfea09cae9f2b42d9300e720921fbbc7.zip | |
upd: add multipart/form support to a few mastodon endpoints
Diffstat (limited to 'packages/backend/src')
| -rw-r--r-- | packages/backend/src/server/api/mastodon/MastodonApiServerService.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index c0e4ea80dc..5706a17786 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -226,7 +226,7 @@ export class MastodonApiServerService { reply.send([]); }); - fastify.post('/v1/apps', async (_request, reply) => { + fastify.post('/v1/apps', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const client = getClient(BASE_URL, ''); // we are using this here, because in private mode some info isnt // displayed without being logged in @@ -460,7 +460,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/follow', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/follow', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -474,7 +474,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/unfollow', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/unfollow', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -488,7 +488,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/block', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/block', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -502,7 +502,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/unblock', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/unblock', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -516,7 +516,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/mute', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/mute', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -530,7 +530,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/unmute', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/accounts/:id/unmute', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -628,7 +628,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/follow_requests/:id/authorize', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/follow_requests/:id/authorize', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -642,7 +642,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/follow_requests/:id/reject', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/follow_requests/:id/reject', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -744,7 +744,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/notification/:id/dismiss', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/notification/:id/dismiss', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -758,7 +758,7 @@ export class MastodonApiServerService { } }); - fastify.post('/v1/notifications/clear', async (_request, reply) => { + fastify.post('/v1/notifications/clear', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -788,7 +788,7 @@ export class MastodonApiServerService { } }); - fastify.post('/v1/filters', async (_request, reply) => { + fastify.post('/v1/filters', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); @@ -802,7 +802,7 @@ export class MastodonApiServerService { } }); - fastify.post<{ Params: { id: string } }>('/v1/filters/:id', async (_request, reply) => { + fastify.post<{ Params: { id: string } }>('/v1/filters/:id', { preHandler: upload.single('none') }, async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); |