feat(api): #9123, migrate /api/post/pid/:pid to Write API

This commit is contained in:
Julian Lam
2020-12-28 19:38:00 -05:00
parent 1002c14aa2
commit e267f29584
5 changed files with 37 additions and 27 deletions

View File

@@ -8,6 +8,10 @@ const apiHelpers = require('../../api/helpers');
const Posts = module.exports;
Posts.get = async (req, res) => {
helpers.formatApiResponse(200, res, await api.posts.get(req, { pid: req.params.pid }));
};
Posts.edit = async (req, res) => {
const editResult = await api.posts.edit(req, {
...req.body,