Update utils.js

This commit is contained in:
freearhey 2021-04-02 22:00:33 +03:00
parent a4dca23ce2
commit 7e8075975a
1 changed files with 5 additions and 4 deletions

View File

@ -184,11 +184,12 @@ utils.writeToFile = function (filename, data) {
}
utils.fetchData = function (item, config) {
const options = config.request
options.url = typeof config.url === 'function' ? config.url(item) : config.url
options.data = typeof options.data === 'function' ? options.data(item) : options.data
const request = { ...config.request }
request.url = typeof config.url === 'function' ? config.url(item) : config.url
request.data =
typeof config.request.data === 'function' ? config.request.data(item) : config.request.data
return axios(options)
return axios(request)
}
utils.getUTCDate = function () {