1
0
mirror of https://github.com/tooot-app/app synced 2024-12-23 16:20:08 +01:00

Another fix #597

This commit is contained in:
xmflsct 2022-12-21 15:21:35 +01:00
parent b36863337e
commit a0bfb6cb24
2 changed files with 8 additions and 2 deletions

View File

@ -44,7 +44,10 @@ const apiGeneral = async <T = unknown>({
...userAgent,
...headers
},
...((body as (FormData & { _parts: [][] }) | undefined)?._parts.length && { data: body })
...(body &&
(body instanceof FormData
? (body as (FormData & { _parts: [][] }) | undefined)?._parts?.length
: Object.keys(body).length) && { data: body })
})
.then(response => {
let links: {

View File

@ -47,7 +47,10 @@ const apiTooot = async <T = unknown>({
...userAgent,
...headers
},
...((body as (FormData & { _parts: [][] }) | undefined)?._parts.length && { data: body })
...(body &&
(body instanceof FormData
? (body as (FormData & { _parts: [][] }) | undefined)?._parts?.length
: Object.keys(body).length) && { data: body })
})
.then(response => {
return Promise.resolve({