fetchp icon indicating copy to clipboard operation
fetchp copied to clipboard

Increase user-friendliness of `useFetchp` for POST requests

Open 9ssi7 opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. no it's not a problem it's just syntax sugar.

Describe the solution you'd like I feel like I'm actually using fetch when making a POST request.

For example right now my POST request looks like this:

const { data, error, doFetch, isFetching } = useFetchp('GET', 'localhost:3050/api/auth/v1/register')

doFetch({
	body: JSON.stringify({
		email: '[email protected]',
	}),
})

I think we can do it this way:

const { data, error, doFetch, isFetching } = useFetchp('GET', 'localhost:3050/api/auth/v1/register')

doFetch({
	email: '[email protected]',
})

9ssi7 avatar Jan 22 '23 07:01 9ssi7