pl-api: fix content type again
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user