1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

🧊 Remove redundant return awaits

This commit is contained in:
Steffo 2021-05-23 18:22:30 +02:00
parent 355095ce7d
commit c9f1825c3c
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -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],
)