Fix undefined request body when body === false or 0, "".

This commit is contained in:
visortelle 2022-06-13 14:06:08 +03:00 committed by GitHub
parent e180ba3f15
commit 1bec18e664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
const getRequestBody = (options: ApiRequestOptions): any => {
if (options.body) {
if (options.body !== undefined) {
if (options.mediaType?.includes('/json')) {
return JSON.stringify(options.body)
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {