Skip to content

Commit aa20f9e

Browse files
authored
Merge pull request ferdikoomen#1076 from visortelle/patch-1
Fix undefined request body when body is a valid JSON falsy value: false or 0, "".
2 parents e180ba3 + 1bec18e commit aa20f9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/templates/core/fetch/getRequestBody.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const getRequestBody = (options: ApiRequestOptions): any => {
2-
if (options.body) {
2+
if (options.body !== undefined) {
33
if (options.mediaType?.includes('/json')) {
44
return JSON.stringify(options.body)
55
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {

0 commit comments

Comments
 (0)