feat(web): introduce saving and discarding changes

This commit is contained in:
2023-01-31 02:08:42 +03:00
parent 70ac14a17a
commit fefff3ce45
2 changed files with 29 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
$(document).on("click", "#btn-save", function (e) {
e.preventDefault();
let resp = tdb_query("$TFM", 4, "");
if (resp.status) {
alert("Successfully saved!");
} else {
alert("Something went wrong!");
}
});
$(document).on("click", "#btn-discard", function (e) {
e.preventDefault();
if (!confirm("All unsaved changes will be lost permanently. Are you sure?")) {
return;
}
let resp = tdb_query("$TFM", 2, "");
if (resp.status) {
alert("Successfully reloaded database!");
} else {
alert("Something went wrong!");
}
});