support FormData for body

This commit is contained in:
2023-02-28 15:42:16 +10:00
parent 96076af037
commit c24c1f54be

View File

@@ -87,7 +87,10 @@ export const api = {
signal: options.signal || null,
};
if (typeof options.body == "string" && options.body.length > 0) {
if (
(typeof options.body == "string" && options.body.length > 0) ||
options.body instanceof FormData
) {
fetchOptions.body = options.body;
}