From c9f1825c3cb16c58f014862c72dc3f6e101c47fe Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 23 May 2021 18:22:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=8A=20Remove=20redundant=20`return=20a?= =?UTF-8?q?wait`s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nest_frontend/hooks/useBackendResource.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nest_frontend/hooks/useBackendResource.js b/nest_frontend/hooks/useBackendResource.js index 5a447ad..71ae26b 100644 --- a/nest_frontend/hooks/useBackendResource.js +++ b/nest_frontend/hooks/useBackendResource.js @@ -29,7 +29,7 @@ export default function useBackendResource( if(!allowRetrieve) { throw new ViewNotAllowedError("retrieve") } - return await apiRequest("GET", `${resourcePath}`, undefined, init) + return apiRequest("GET", `${resourcePath}`, undefined, init) }, [apiRequest, allowRetrieve, resourcePath], ) @@ -39,7 +39,7 @@ export default function useBackendResource( if(!allowEdit) { throw new ViewNotAllowedError("edit") } - return await apiRequest("PUT", `${resourcePath}`, data, init) + return apiRequest("PUT", `${resourcePath}`, data, init) }, [apiRequest, allowEdit, resourcePath], ) @@ -49,7 +49,7 @@ export default function useBackendResource( if(!allowDestroy) { throw new ViewNotAllowedError("destroy") } - return await apiRequest("DELETE", `${resourcePath}`, undefined, init) + return apiRequest("DELETE", `${resourcePath}`, undefined, init) }, [apiRequest, allowDestroy, resourcePath], ) @@ -59,7 +59,7 @@ export default function useBackendResource( if(!allowAction) { throw new ViewNotAllowedError("action") } - return await apiRequest(method, `${resourcePath}/${command}`, data, init) + return apiRequest(method, `${resourcePath}/${command}`, data, init) }, [apiRequest, allowAction, resourcePath], )