Skip to content

Commit

Permalink
feat: req12 - parcial
Browse files Browse the repository at this point in the history
  • Loading branch information
dopimentel committed Feb 21, 2024
1 parent 3cbc0ba commit 940e0b9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/controllers/postController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { postService } = require('../services');

const create = async (req, res, next) => {
const { title, content, categoryIds, userId } = req.body;
const response = await postService.create({ title, content, categoryIds, userId });
if (response.error) return next(response.error);
res.status(201).json(response);
};

module.exports = {
create,
};

0 comments on commit 940e0b9

Please sign in to comment.