From 3e876de648dfc274ee456f7faaaaa47409a57034 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 29 Sep 2016 23:06:50 +0200 Subject: Fix server bugs --- modules/changes/changes.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/changes/changes.html') diff --git a/modules/changes/changes.html b/modules/changes/changes.html index e084f2f..bdd0fa3 100644 --- a/modules/changes/changes.html +++ b/modules/changes/changes.html @@ -125,6 +125,10 @@ function makeURLtr(url){ ev.stopPropagation(); if(!confirm("Delete the following url?\n"+url))return; fetch("DELETE","/changes/url",url,function(status,body){ + if(status!=200){ + alert("Error deleting: ("+status+") "+body); + return; + } var tlh=document.getElementById("timelineheader"); if(tlh.firstChild&&tlh.firstChild.nodeValue==url){ document.getElementById("timelinecontainer").classList.remove("visible"); @@ -150,7 +154,7 @@ function makeURLtr(url){ function updateURLs(){ fetch("GET","/changes/urls",function(status,body){ urls=JSON.parse(body); - if(!urls){ + if(status!=200||!urls){ urls=[]; alert("Error retrieving URLs!"); return; -- cgit v1.2.3-54-g00ecf