Created
May 26, 2021 18:33
-
-
Save sergueyarellano/f38becf5d1fa5af5e7eee5f6769b2ea8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function composeRequest (payload) { | |
const newPayload = cloneDeep(payload) | |
const { host, headers, method, endpoint } = get(payload, 'data.config', {}) | |
const requestOptions = { | |
uri: new URL(endpoint, host), | |
options: { | |
headers, | |
method | |
} | |
} | |
return set(newPayload, 'data.request', requestOptions) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment