pl-api: fix

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-19 14:57:20 +01:00
parent b3725962cd
commit b1b8bf3e59
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ const media = (client: PlApiBaseClient) => ({
uploadMedia: async (params: UploadMediaParams, meta?: RequestMeta) => {
const response = await client.request(
client.features.mediaV2 ? '/api/v2/media' : '/api/v1/media',
{ ...meta, method: 'POST', body: params, contentType: '' },
{ ...meta, method: 'POST', body: params, formData: true },
);
return v.parse(mediaAttachmentSchema, response.json);

View File

@ -19,7 +19,7 @@ const oauth = (client: PlApiBaseClient) => ({
* @see {@link https://docs.joinmastodon.org/methods/oauth/#authorize}
*/
authorize: async (params: OauthAuthorizeParams) => {
const response = await client.request('/oauth/authorize', { params, contentType: '' });
const response = await client.request('/oauth/authorize', { params, formData: true });
return v.parse(v.string(), response.json);
},