pl-api: fix content type again

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-28 12:23:12 +01:00
parent 9b4ff014a9
commit 75a892e7c5
3 changed files with 6 additions and 7 deletions

View File

@@ -98,7 +98,7 @@ const experimental = (client: PlApiBaseClient) => {
description: params.note,
membership: 'public',
},
contentType: params.avatar || params.header ? '' : undefined,
formData: !!(params.avatar || params.header),
});
if (response.json?.id) {
@@ -108,7 +108,7 @@ const experimental = (client: PlApiBaseClient) => {
response = await client.request('/api/v1/groups', {
method: 'POST',
body: params,
contentType: params.avatar || params.header ? '' : undefined,
formData: !!(params.avatar || params.header),
});
}
@@ -133,7 +133,7 @@ const experimental = (client: PlApiBaseClient) => {
const response = await client.request(`/api/v1/groups/${groupId}`, {
method: 'PUT',
body: params,
contentType: params.avatar || params.header ? '' : undefined,
formData: !!(params.avatar || params.header),
});
return v.parse(groupSchema, response.json);

View File

@@ -42,7 +42,7 @@ const media = (client: PlApiBaseClient) => ({
const response = await client.request(`/api/v1/media/${attachmentId}`, {
method: 'PUT',
body: params,
contentType: params.thumbnail ? '' : undefined,
formData: !!params.thumbnail,
});
return v.parse(mediaAttachmentSchema, response.json);

View File

@@ -81,13 +81,12 @@ const settings = (client: PlApiBaseClient) => ({
const response = await client.request('/api/v1/accounts/update_credentials', {
method: 'PATCH',
contentType:
formData: !!(
client.features.version.software === GOTOSOCIAL ||
client.features.version.software === ICESHRIMP_NET ||
params.avatar ||
params.header
? ''
: undefined,
),
body: params,
});