fix ban and delete modals

master
justcool393 2022-10-19 13:00:33 -05:00
parent 457acd43cb
commit 2386a2e04b
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ function banModal(link, id, name) {
const xhr = createXhrWithFormKey(`/ban_user/${id}?form`, "POST", form); const xhr = createXhrWithFormKey(`/ban_user/${id}?form`, "POST", form);
xhr[0].onload = function() { xhr[0].onload = function() {
let data let data
try {data = JSON.parse(xhr.response)} try {data = JSON.parse(xhr[0].response)}
catch(e) {console.log(e)} catch(e) {console.log(e)}
success = xhr[0].status >= 200 && xhr[0].status < 300; success = xhr[0].status >= 200 && xhr[0].status < 300;
showToast(success, getMessageFromJsonData(success, data)); showToast(success, getMessageFromJsonData(success, data));

View File

@ -3,7 +3,7 @@ function delete_postModal(id) {
const xhr = createXhrWithFormKey(`/delete_post/${id}`); const xhr = createXhrWithFormKey(`/delete_post/${id}`);
xhr[0].onload = function() { xhr[0].onload = function() {
let data let data
try {data = JSON.parse(xhr.response)} try {data = JSON.parse(xhr[0].response)}
catch(e) {console.log(e)} catch(e) {console.log(e)}
success = xhr[0].status >= 200 && xhr[0].status < 300; success = xhr[0].status >= 200 && xhr[0].status < 300;
showToast(success, getMessageFromJsonData(success, data)); showToast(success, getMessageFromJsonData(success, data));