MCPcopy Create free account
hub / github.com/codemistic/Web-Development / getPost

Function getPost

project_mern_memories/server/controllers/posts.js:18–28  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

16}
17
18export const getPost = async (req, res) => {
19 const { id } = req.params;
20
21 try {
22 const post = await PostMessage.findById(id);
23
24 res.status(200).json(post);
25 } catch (error) {
26 res.status(404).json({ message: error.message });
27 }
28}
29
30export const createPost = async (req, res) => {
31 const { title, message, selectedFile, creator, tags } = req.body;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected