From 47e82adbad566ad12b93c92f06e5abbdde0a2afd Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 16 Jun 2021 19:39:09 -0500 Subject: [PATCH] No reload when deleting chat --- templates/chat/chat.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/chat/chat.html b/templates/chat/chat.html index b839939..122ab2c 100644 --- a/templates/chat/chat.html +++ b/templates/chat/chat.html @@ -135,9 +135,11 @@ data: elt.data(), dataType: 'json', success: function(data){ - console.log('delete ajax call success!'); - location.reload(); - } + elt.closest('li').hide(); + }, + fail: function(data) { + alert('Fail to delete'); + }, }); }); {% endif %}