restyped-axios icon indicating copy to clipboard operation
restyped-axios copied to clipboard

Why the optional '?' type operator for PUT POST, PATCH data?

Open gewoonwoutje opened this issue 6 years ago • 0 comments

The second parameter of the TypedAxiosInstance post(...), put(...) and patch(...) methods is always optional now. I would expect giving a body argument to be mandatory.

If I want the body to be optional (for whatever reason), I could still define MyObject | undefined in my API body, and give undefined as second argument to the functions.

gewoonwoutje avatar Jan 14 '19 16:01 gewoonwoutje