forked from Adleraci/adlerka.top
add silent
This commit is contained in:
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 => {
|
||||
if(!silent) {
|
||||
handleResponse(data, successMessage, failureMessage);
|
||||
}
|
||||
return data; // Returning the response data for further processing
|
||||
})
|
||||
.catch((error) => {
|
||||
|
Loading…
Reference in New Issue
Block a user