add silent

This commit is contained in:
Bruno Rybársky 2024-02-03 22:44:01 +01:00
parent a31a92b692
commit 2275d1623a

@ -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) => {