Skip to content

Commit 3fe2b5c

Browse files
authored
Merge pull request #560 from akatsoulas/fix-404-reply
Fix 404 when moderating questions
2 parents 0d85e0c + bb8ff52 commit 3fe2b5c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/src/js/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ function init() {
6767
});
6868

6969
const moderateForm = document.getElementById('moderate-form');
70+
const moderateBaseAction = moderateForm ? moderateForm.getAttribute('action') : null;
7071
document.querySelectorAll('.moderate-button').forEach((btn) => {
7172
btn.addEventListener('click', () => {
7273
if (moderateForm) {
7374
moderateForm.setAttribute(
7475
'action',
75-
`${moderateForm.getAttribute('action')}${btn.id}/rejected`,
76+
`${moderateBaseAction}${btn.id}/rejected`,
7677
);
7778
}
7879
});

0 commit comments

Comments
 (0)