From 2275d1623a5fc3ba099de542575bd1fee36e9fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 3 Feb 2024 22:44:01 +0100 Subject: [PATCH] add silent --- assets/script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/script.js b/assets/script.js index 082caa1..d980d0e 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,4 +1,4 @@ -function doAccountAction(requestData, successMessage, failureMessage) { +function doAccountAction(requestData, successMessage, failureMessage, silent=false) { return fetch('/account', { method: 'POST', body: requestData, @@ -10,7 +10,9 @@ function doAccountAction(requestData, successMessage, failureMessage) { return response.json(); }) .then(data => { - handleResponse(data, successMessage, failureMessage); + if(!silent) { + handleResponse(data, successMessage, failureMessage); + } return data; // Returning the response data for further processing }) .catch((error) => {