feat: enhance user confirmation and data submission; add newEntry function and update MainForm to handle user selection

This commit is contained in:
2026-01-20 18:50:16 +01:00
parent 001999f21d
commit fd37e40253
5 changed files with 57 additions and 34 deletions

View File

@@ -3,15 +3,16 @@ import dotenv from "dotenv";
const router = express.Router();
dotenv.config();
import { getUser, confirmData, confirmUser } from "./frontend.data.js";
import { getUser, newEntry, confirmUser } from "./frontend.data.js";
router.post("/frontend", async (req, res) => {
const result = await confirmData(req.body);
router.post("/new-entry", async (req, res) => {
const username = req.query.username;
const result = await newEntry(req.body, username);
if (!result.success) {
return res.status(500).json({ message: "Form Data Invalid" });
}
console.log(req.body);
console.log(user);
console.log(username);
res.sendStatus(204);
});