From a66e10fc1aad6e88c6a8263618a3ce729b6af1e9 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Fri, 6 Nov 2020 04:57:12 +0300 Subject: [PATCH] feat(request-hook): allow autofetching for... POST, PUT, PATCH methods Closes #13 --- src/request-hook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/request-hook.ts b/src/request-hook.ts index bc292d1..2cba9f7 100644 --- a/src/request-hook.ts +++ b/src/request-hook.ts @@ -15,7 +15,7 @@ export function useRequest, V = Record, P = config?: RequestConfig, ) { invariant( - endpoint.method == Method.GET, + endpoint.method !== Method.DELETE, `You cannot use useRequest with ${endpoint.method} method` );