Skip to content

Commit

Permalink
Merge pull request #134 from BMartinos/fix/incorrect-axios-auth-usage
Browse files Browse the repository at this point in the history
Fix incorrect Axios auth usage
  • Loading branch information
ashaban authored May 20, 2024
2 parents 52a1880 + 73b64c4 commit 2d9fffc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/lib/tools/cacheFHIR.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 2d9fffc

Please sign in to comment.