Skip to content

Commit

Permalink
avoid for-in
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Jul 21, 2021
1 parent aa9cd80 commit 2af9a6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2971,11 +2971,11 @@ function showDeletePopup() {

const dialog = $(`.delete.modal${filter}`);
dialog.find('.name').text($this.data('name'));
for (const key of Object.keys(dataArray)) {
Object.keys(dataArray).forEach((key) => {
if (key && key.startsWith('data')) {
dialog.find(`.${key}`).text(dataArray[key]);
}
}
});

dialog.modal({
closable: false,
Expand All @@ -2988,14 +2988,14 @@ function showDeletePopup() {
const postData = {
_csrf: csrf,
};
for (const key of Object.keys(dataArray)) {
Object.keys(dataArray).forEach((key) => {
if (key && key.startsWith('data')) {
postData[key.substr(4)] = dataArray[key];
}
if (key === 'id') {
postData['id'] = dataArray['id'];
}
}
});

$.post($this.data('url'), postData).done((data) => {
window.location.href = data.redirect;
Expand Down

0 comments on commit 2af9a6f

Please sign in to comment.