mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
use makeRequest
This commit is contained in:
parent
e30fc01ba4
commit
4186a99f02
@ -31,7 +31,8 @@ export default function generateHTTPRequestDispatcher({
|
||||
error: null,
|
||||
}
|
||||
|
||||
const request = await instance(requestParams)
|
||||
const makeRequest = async () => {
|
||||
return await instance(requestParams)
|
||||
.then((response) => {
|
||||
result.response = response
|
||||
|
||||
@ -42,9 +43,12 @@ export default function generateHTTPRequestDispatcher({
|
||||
|
||||
return error
|
||||
})
|
||||
}
|
||||
|
||||
const request = await makeRequest()
|
||||
|
||||
if (typeof handleResponse === "function") {
|
||||
await handleResponse(request)
|
||||
await handleResponse(request, makeRequest)
|
||||
}
|
||||
|
||||
if (requestParams.parseData) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user