Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
471 B
3
Indexable
Never
const blogPostService = require('../services/services.blogPost');

const makeNewPost = async (req, res) => {
  const newPost = req.body;
  const { id } = req.user;
  const post = await blogPostService.makeNewPost(newPost, id);
  res.status(201).json(post);
};
const findAllPosts = async (req, res) => {
  const { id } = req.user;
  const newPost = await blogPostService.findAllPosts(id);
  res.status(200).json(newPost);
};
module.exports = { makeNewPost, findAllPosts };
Leave a Comment