Fix ban checkbox being passed into ban payload
This commit is contained in:
parent
b196cbdd1c
commit
b249e40273
|
@ -23,18 +23,13 @@ load = ->
|
||||||
modalForm.addEventListener "submit", (event) ->
|
modalForm.addEventListener "submit", (event) ->
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
checktostr = (el) ->
|
|
||||||
if el.checked
|
|
||||||
"1"
|
|
||||||
else
|
|
||||||
"0"
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
ban: banCheckbox ? checktostr banCheckbox : false
|
ban: "0"
|
||||||
user: modalForm.elements["user"].value
|
user: modalForm.elements["user"].value
|
||||||
}
|
}
|
||||||
|
|
||||||
if banCheckbox && banCheckbox.checked
|
if banCheckbox && banCheckbox.checked
|
||||||
|
data.ban = "1"
|
||||||
data.reason = modalForm.elements["reason"].value.trim()
|
data.reason = modalForm.elements["reason"].value.trim()
|
||||||
unless permabanCheckbox.checked
|
unless permabanCheckbox.checked
|
||||||
data.duration = modalForm.elements["duration"].value.trim()
|
data.duration = modalForm.elements["duration"].value.trim()
|
||||||
|
|
Loading…
Reference in New Issue