fix: added support for comment edit mod passthrough

This commit is contained in:
Wyatt Johnson
2018-08-07 13:56:23 -06:00
parent 2edb8e8d0a
commit 6bb98a00dc
3 changed files with 146 additions and 93 deletions
+17 -2
View File
@@ -293,7 +293,16 @@ const setStatus = async (ctx, { id, status }) => {
*/
const editComment = async (
ctx,
{ id, asset_id, edit: { body, metadata = {} } }
{
id,
asset_id,
edit: {
body,
metadata = {},
status: commentStatus,
actions: commentActions = [],
},
}
) => {
const {
connectors: {
@@ -303,7 +312,13 @@ const editComment = async (
// Build up the new comment we're setting. We need to check this with
// moderation now.
let comment = { id, asset_id, body };
let comment = {
id,
asset_id,
body,
status: commentStatus,
actions: commentActions,
};
// Determine the new status of the comment.
const { actions, status } = await Moderation.process(ctx, comment);