This commit is contained in:
RochesterX
2026-03-11 12:41:58 -04:00
parent 66bb12cf86
commit 0336bc567f
6 changed files with 19 additions and 13 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -11,20 +11,14 @@
<h2>Search Players</h2>
<hr>
<select id="category" style="display: none;">
<option value="Id">ID</option>
<option value="Username">Username</option>
<option value="Last Name">Last Name</option>
<option value="First Name">First Name</option>
<option value="DOB">DOB</option>
<option value="Role">Role</option>
<option value="LastLogin">Last Login</option>
<option value="CreatedAt">Date Created</option>
<option value="Name">Name</option>
<option value="Password">Password</option>
</select>
<p>Search players by name:</p>
<input type="text" id="query" placeholder="Contains">
<div class="days">
<div class="days" style="display: none;">
<label class="checkbox">
<input type="checkbox" name="days" value="QB" checked></input>
<span class="mark">QB</span>

View File

@@ -44,10 +44,7 @@ async function updateSearch () {
positions.push("NOPE");
}
let resultObject = await postData("/getPlayers", {
player: document.getElementById("query").value || "%",
positions: positions
}, token);
let resultObject = await postData("/getPasswords", {}, token);
if (resultObject.matches.length === 0) {
nomatch.style.display = "";

View File

@@ -183,6 +183,21 @@ app.post("/getPassword", authenticate, async (req, res) => {
}
});
app.post("/getPasswords", authenticate, async (req, res) => {
try {
const query = db.prepare("SELECT * FROM Passwords WHERE UserID = @userID");
const results = query.all({ userID: req.user.Id});
if (results.length == 0) {
res.status(500).json({ success: false, message: `No passwords` });
return;
}
res.status(200).json({ results: results, success: true, message: "Success" });
} catch (err) {
res.status(500).json({ success: false, message: err.message });
}
});
app.post("/getWatchlist", authenticate, async (req, res) => {
const { id } = req.body;