Untitled
Anonymous
plain_text
02/01/2024 2:27 PM
628 B
17
Indexable
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 };Editor is loading...
Leave a Comment