From 7e8075975a36625b9759a016e3a75c5d2b174b43 Mon Sep 17 00:00:00 2001 From: freearhey Date: Fri, 2 Apr 2021 22:00:33 +0300 Subject: [PATCH] Update utils.js --- src/utils.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils.js b/src/utils.js index d59af00..b3785cf 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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 () {