mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-16 04:09:59 +01:00
Fix ban checkbox being passed into ban payload
This commit is contained in:
parent
b196cbdd1c
commit
b249e40273
1 changed files with 2 additions and 7 deletions
|
@ -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 a new issue