feat: update user retrieval and add new users table; enhance MainForm with user fetching and localization support
This commit is contained in:
@@ -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) => {};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user