From a6054ff6a59afc652014496458f98c5034fc0923 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 17 Mar 2020 17:06:59 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B5=84=E4=BA=A7=EF=BC=8C=E5=BD=93=E5=BE=85?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=95=B0=E9=87=8F=E5=92=8C=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=80=BB=E6=95=B0=E7=9B=B8=E7=AD=89=E6=97=B6=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=88=A0=E9=99=A4=E5=A4=B1=E8=B4=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/templates/assets/asset_list.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/assets/templates/assets/asset_list.html b/apps/assets/templates/assets/asset_list.html index f7588043a..24a789404 100644 --- a/apps/assets/templates/assets/asset_list.html +++ b/apps/assets/templates/assets/asset_list.html @@ -258,6 +258,10 @@ $(document).ready(function(){ confirmButtonText: "{% trans 'Confirm' %}", closeOnConfirm: false },function () { + function fail() { + var msg = "{% trans 'Asset Deleting failed.' %}"; + swal("{% trans 'Asset Delete' %}", msg, "error"); + } function success(data) { url = setUrlParam(the_url, 'spm', data.spm); requestApi({ @@ -268,13 +272,10 @@ $(document).ready(function(){ swal("{% trans 'Asset Delete' %}", msg, "success"); reloadTable(); }, + error: fail, flash_message: false, }); } - function fail() { - var msg = "{% trans 'Asset Deleting failed.' %}"; - swal("{% trans 'Asset Delete' %}", msg, "error"); - } requestApi({ url: "{% url 'api-common:resources-cache' %}", method: 'POST',