forked from MarseyWorld/MarseyWorld
fix ban and delete modals
parent
457acd43cb
commit
2386a2e04b
|
@ -8,7 +8,7 @@ function banModal(link, id, name) {
|
|||
const xhr = createXhrWithFormKey(`/ban_user/${id}?form`, "POST", form);
|
||||
xhr[0].onload = function() {
|
||||
let data
|
||||
try {data = JSON.parse(xhr.response)}
|
||||
try {data = JSON.parse(xhr[0].response)}
|
||||
catch(e) {console.log(e)}
|
||||
success = xhr[0].status >= 200 && xhr[0].status < 300;
|
||||
showToast(success, getMessageFromJsonData(success, data));
|
||||
|
|
|
@ -3,7 +3,7 @@ function delete_postModal(id) {
|
|||
const xhr = createXhrWithFormKey(`/delete_post/${id}`);
|
||||
xhr[0].onload = function() {
|
||||
let data
|
||||
try {data = JSON.parse(xhr.response)}
|
||||
try {data = JSON.parse(xhr[0].response)}
|
||||
catch(e) {console.log(e)}
|
||||
success = xhr[0].status >= 200 && xhr[0].status < 300;
|
||||
showToast(success, getMessageFromJsonData(success, data));
|
||||
|
|
Loading…
Reference in New Issue