feat: update getAll25 function to return consistent response format and modify frontend route to handle async data retrieval
This commit is contained in:
@@ -5,10 +5,11 @@ dotenv.config();
|
||||
|
||||
import { getAll25 } from "./frontend.data.js";
|
||||
|
||||
router.post("/frontend", (req, res) => {
|
||||
router.post("/frontend", async (req, res) => {
|
||||
console.log(req.body);
|
||||
res.status(200).json({ message: "Data received successfully" });
|
||||
console.log(getAll25());
|
||||
const data = await getAll25();
|
||||
console.log(data);
|
||||
res.status(200);
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user