Skip to content

Commit 2af9a6f

Browse files
committed
avoid for-in
Signed-off-by: Andrew Thornton <[email protected]>
1 parent aa9cd80 commit 2af9a6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web_src/js/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2971,11 +2971,11 @@ function showDeletePopup() {
29712971

29722972
const dialog = $(`.delete.modal${filter}`);
29732973
dialog.find('.name').text($this.data('name'));
2974-
for (const key of Object.keys(dataArray)) {
2974+
Object.keys(dataArray).forEach((key) => {
29752975
if (key && key.startsWith('data')) {
29762976
dialog.find(`.${key}`).text(dataArray[key]);
29772977
}
2978-
}
2978+
});
29792979

29802980
dialog.modal({
29812981
closable: false,
@@ -2988,14 +2988,14 @@ function showDeletePopup() {
29882988
const postData = {
29892989
_csrf: csrf,
29902990
};
2991-
for (const key of Object.keys(dataArray)) {
2991+
Object.keys(dataArray).forEach((key) => {
29922992
if (key && key.startsWith('data')) {
29932993
postData[key.substr(4)] = dataArray[key];
29942994
}
29952995
if (key === 'id') {
29962996
postData['id'] = dataArray['id'];
29972997
}
2998-
}
2998+
});
29992999

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

0 commit comments

Comments
 (0)