From cc8053f8fdfe7c96d11153e8e35c9d6ca4e8b5a4 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 3 Nov 2020 15:33:59 -0800 Subject: [PATCH] Alert response if set searchhidden fails. --- frontends/etiquette_flask/templates/photo.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/templates/photo.html b/frontends/etiquette_flask/templates/photo.html index 864d2f2..094515d 100644 --- a/frontends/etiquette_flask/templates/photo.html +++ b/frontends/etiquette_flask/templates/photo.html @@ -433,11 +433,20 @@ function set_searchhidden_form(event) const checkbox = event.target; if (checkbox.checked) { - api.photos.set_searchhidden(PHOTO_ID); + api.photos.set_searchhidden(PHOTO_ID, set_searchhidden_callback); } else { - api.photos.unset_searchhidden(PHOTO_ID); + api.photos.unset_searchhidden(PHOTO_ID, set_searchhidden_callback); + } +} + +function set_searchhidden_callback(response) +{ + if (response.meta.status !== 200) + { + alert(JSON.stringify(response)); + return; } }