handle an error from the hit endpoint

This commit is contained in:
Joe Ardent 2024-03-30 16:23:17 -07:00
parent 87afa418b2
commit 732156dcd6
1 changed files with 6 additions and 1 deletions

View File

@ -17,9 +17,14 @@
<script defer>
const hits = document.getElementById('hitman-count');
fetch("/hit/{{ page.slug }}").then((resp) => {
return resp.text();
if (resp.ok) {
return resp.text();
} else {
return "no";
}
}).then((data) => {
hits.innerHTML = data;
});
</script>
{% endblock main_content %}