Skip to content

Commit

Permalink
Merge pull request #701 from favicode/fix/api-keys-for-log-endpoints
Browse files Browse the repository at this point in the history
Logging endpoints changes
  • Loading branch information
vvuksan authored Jul 2, 2024
2 parents 0ff2865 + 83e4985 commit 5a8dd4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion view/adminhtml/web/js/log-endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,16 @@ define([
}

const formElements = document.forms['create-log-endpoint-form'].elements;
// Inputs which should be available only on endpoint creation and shouldn't be used on update, such as API keys
const createLogInputs = ['access_key', 'secret_key', 'token', 'sas_token'];
for (const prop in endpoint) {
let element = formElements.namedItem(`log_endpoint[${prop}]`);
if (element) {
$(element).val(endpoint[prop]);
if (createLogInputs.includes(prop) && endpoint[prop]) {
$(element).remove()
} else {
$(element).val(endpoint[prop]);
}
}
}
}
Expand Down

0 comments on commit 5a8dd4e

Please sign in to comment.