From 1dee9c465c89d4f811e68667bad297561de19017 Mon Sep 17 00:00:00 2001 From: Simon L Date: Sat, 17 Dec 2022 12:33:24 +0100 Subject: [PATCH] reload in case of undefined response Signed-off-by: Simon L --- php/public/forms.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/php/public/forms.js b/php/public/forms.js index 4202f31e..029dfd5d 100644 --- a/php/public/forms.js +++ b/php/public/forms.js @@ -19,12 +19,13 @@ const xhr = e.target; if (xhr.status === 201) { window.location.replace(xhr.getResponseHeader('Location')); - } - if (xhr.status === 422) { + } else if (xhr.status === 422) { showError(xhr.response); - } - if (xhr.status === 500) { - showError("Server error. Please see the logs for details."); + } else if (xhr.status === 500) { + showError("Server error. Please check the mastercontainer logs for details."); + } else { + // If the responose is not one of the above, we should reload to show the latest content + window.location.reload(1); } }