diff --git a/server/lib/tools/cacheFHIR.js b/server/lib/tools/cacheFHIR.js index aecb223a..e440b743 100644 --- a/server/lib/tools/cacheFHIR.js +++ b/server/lib/tools/cacheFHIR.js @@ -239,7 +239,7 @@ const updateESCompilationsRate = callback => { username: config.get('elastic:username'), password: config.get('elastic:password'), }; - axios.put(url, body, auth).then(response => { + axios.put(url, body, { auth }).then(response => { if (response.status > 199 && response.status < 299) { logger.info('maximum compilation rate updated successfully'); return callback(false); @@ -287,7 +287,7 @@ const createESIndex = (name, IDFields, reportFields, callback) => { username: config.get('elastic:username'), password: config.get('elastic:password'), }; - axios.put(url, settings, auth).then(response => { + axios.put(url, settings, { auth }).then(response => { if (response.status >= 200 && response.status <= 299) { logger.info('Analyzer created successfully'); return callback(null); @@ -345,7 +345,7 @@ const createESIndex = (name, IDFields, reportFields, callback) => { username: config.get('elastic:username'), password: config.get('elastic:password'), }; - axios.put(url, mapping, auth).then(response => { + axios.put(url, mapping, { auth }).then(response => { if (response.status >= 200 && response.status <= 299) { logger.info('Mappings added successfully into elasticsearch'); return callback(null); @@ -389,7 +389,7 @@ const updateESDocument = (id, index, record, callback) => { username: config.get('elastic:username'), password: config.get('elastic:password') }; - axios.post(url, record, auth).then(response => { + axios.post(url, record, { auth }).then(response => { logger.info(response.data); if (response.data._shards.failed) { logger.warn('Transaction failed, rerunning again');