diff --git a/web/public/js/tdbms.js b/web/public/js/tdbms.js index c930f6c..6d0a1e3 100644 --- a/web/public/js/tdbms.js +++ b/web/public/js/tdbms.js @@ -33,6 +33,15 @@ if (sort_tags == null) { } function tdb_query(trdb, trc, trb) { + if (trb == null) { + trb = ""; + } + if (trc == null) { + trc = 0; + } + if (trdb == null) { + trdb = ""; + } let output = null; $.ajax({ url: "/TDBMS", @@ -58,13 +67,13 @@ function tdb_query(trdb, trc, trb) { } function sasahyou_load() { - let db_info = tdb_query(db_name, 0, ""); + let db_info = tdb_query(db_name); if (db_info == null || !db_info.status) { alert("Failed to fetch database"); throw new Error("Failed to fetch database"); } if (sasahyou == null || sasahyou_mts !== db_info.data[0].sasahyou.mts) { - let resp = tdb_query(db_name, 16, ""); + let resp = tdb_query(db_name, 16); if (resp == null || !resp.status) { alert("Failed to get sasahyou"); throw new Error("Failed to get sasahyou"); @@ -80,13 +89,13 @@ function sasahyou_load() { } function sappyou_load() { - let db_info = tdb_query(db_name, 0, ""); + let db_info = tdb_query(db_name); if (db_info == null || !db_info.status) { alert("Failed to fetch database"); throw new Error("Failed to fetch database"); } if (sappyou == null || sappyou_mts !== db_info.data[0].sappyou.mts) { - let resp = tdb_query(db_name, 32, ""); + let resp = tdb_query(db_name, 32); if (resp == null || !resp.status) { alert("Failed to get sappyou"); throw new Error("Failed to get sappyou"); @@ -102,13 +111,13 @@ function sappyou_load() { } function shoppyou_load() { - let db_info = tdb_query(db_name, 0, ""); + let db_info = tdb_query(db_name); if (db_info == null || !db_info.status) { alert("Failed to fetch database"); throw new Error("Failed to fetch database"); } if (shoppyou == null || shoppyou_mts !== db_info.data[0].shoppyou.mts) { - let resp = tdb_query(db_name, 8, ""); + let resp = tdb_query(db_name, 8); if (resp == null || !resp.status) { alert("Failed to get shoppyou"); throw new Error("Failed to get shoppyou"); diff --git a/web/public/js/tfm-database.js b/web/public/js/tfm-database.js index 1685ccb..39cbcae 100644 --- a/web/public/js/tfm-database.js +++ b/web/public/js/tfm-database.js @@ -5,7 +5,7 @@ if (db_name == null) { $(document).on("click", "#btn-save", function (e) { e.preventDefault(); - let resp = tdb_query(db_name, 4, ""); + let resp = tdb_query(db_name, 4); if (resp.status) { alert("Successfully saved!"); } else { @@ -18,7 +18,7 @@ $(document).on("click", "#btn-discard", function (e) { if (!confirm("All unsaved changes will be lost permanently. Are you sure?")) { return; } - let resp = tdb_query(db_name, 2, ""); + let resp = tdb_query(db_name, 2); if (resp.status) { alert("Successfully reloaded database!"); } else { diff --git a/web/public/js/tfm-files.js b/web/public/js/tfm-files.js index 8867db3..8f0672a 100644 --- a/web/public/js/tfm-files.js +++ b/web/public/js/tfm-files.js @@ -7,12 +7,12 @@ $(window).on("load", function () { appendScroll: $(".contents-wrapper")[0], }); }); - sasahyou_load(db_name); + sasahyou_load(); sasahyou.forEach((sasa) => { $(".contents-wrapper").append(`