fix(web): fix tdb response checking in js

This commit is contained in:
2023-02-17 23:51:45 +03:00
parent 880d4df453
commit c9b921becf
9 changed files with 53 additions and 49 deletions
+3 -3
View File
@@ -2,17 +2,17 @@ $(document).on("submit", "#newdb", function (e) {
e.preventDefault();
let newdb_name = $("#newdb-name").val(), newdb_path = $("#newdb-path").val();
let resp = tdb_query(newdb_name, 3);
if (!resp.status) {
if (resp == null || !resp.status) {
alert("Failed to initialize database!");
return;
}
resp = tdb_query(newdb_name, 4, newdb_path);
if (!resp.status) {
if (resp == null || !resp.status) {
alert("Failed to save database!");
return;
}
resp = tdb_query(newdb_name, 6, "path=" + newdb_path);
if (!resp.status) {
if (resp == null || !resp.status) {
alert("Failed to finalize database!");
return;
}