fix: app.route overload

This commit is contained in:
PrimarchPaul
2025-09-27 04:15:51 -04:00
parent b1ff9973f4
commit f71e639d49
5 changed files with 117 additions and 16 deletions

View File

@@ -1,7 +1,8 @@
import { Hono } from "hono"
import { fetchUserData } from "../controller/actions"
const actions = new Hono()
/*
actions.post("actions/message/:id", (c) => {
//todo: pass service function to send a message to user id
})
@@ -14,14 +15,22 @@ actions.get("actions/message/all/:userId", (c) => {
//todo: pass service function to fetch all messages f a user
})
actions.get("actions/:id", (c) => {
//todo: pass service function to fetch user data by id
})
actions.get("actions/userChannels/:id", (c) => {
//todo: pass service function to fetch all channels the id is part of
})
*/
actions.get("actions/:id", async (c) => {
const id = c.req.param("id");
const userData = await fetchUserData(id);
if (userData) {
return c.json(userData);
} else {
return c.json({ error: "User not found" }, 404);
}
})
export default actions