Form filling from search result and unregitration

This commit is contained in:
Claude Brisson
2023-12-18 09:29:37 +01:00
parent 98192a1ebc
commit 47ceb8dbe7
7 changed files with 171 additions and 20 deletions

View File

@@ -128,6 +128,27 @@ let api = {
.finally(() => {
spinner(false);
});
}
},
deleteJson: (path, body) => {
clearFeedback();
spinner(true);
return api.delete(path, body)
.then(resp => {
if (resp.ok) {
success();
return resp.json();
}
else throw resp;
})
.catch(err => {
error(err);
return 'error';
})
.finally(() => {
spinner(false);
});
}
};