feat(writeapi): topic posting and replying

This commit is contained in:
Julian Lam
2020-10-01 14:26:34 -04:00
parent 40dc1c38d3
commit 4c833d0bf0
8 changed files with 129 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ const utils = require('../utils');
const apiController = require('../controllers/api');
const sockets = require('.');
const SocketPosts = module.exports;
require('./posts/edit')(SocketPosts);
@@ -23,6 +24,8 @@ require('./posts/tools')(SocketPosts);
require('./posts/diffs')(SocketPosts);
SocketPosts.reply = async function (socket, data) {
sockets.warnDeprecated(socket, 'POST /api/v1/topics/:tid');
if (!data || !data.tid || (meta.config.minimumPostLength !== 0 && !data.content)) {
throw new Error('[[error:invalid-data]]');
}