feat: update user retrieval and add new users table; enhance MainForm with user fetching and localization support

This commit is contained in:
2026-01-19 12:38:50 +01:00
parent 9bc22300eb
commit 1208d731ca
7 changed files with 54 additions and 12 deletions

View File

@@ -12,14 +12,14 @@ const pool = mysql
.promise();
export const getUser = async () => {
const [rows] = await pool.query("SELECT unique_key FROM users");
const [rows] = await pool.query("SELECT username FROM usersNEW");
if (rows.length > 0) {
return {rows};
const users = rows.map((r) => r.username);
return { users };
} else {
return { message: "No data found" };
return { users: [], message: "No data found" };
}
};
export const confirmData = async (data) => {
}
export const confirmData = async (data) => {};

View File

@@ -16,4 +16,9 @@ router.post("/frontend", async (req, res) => {
res.sendStatus(204);
});
router.get("/users", async (req, res) => {
const users = await getUser();
res.json(users);
});
export default router;