From 005602a738c67542252731a094442afa6b49156a Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 6 Mar 2018 11:03:58 -0700 Subject: [PATCH] Standardized metadata --- graph/mutators/comment.js | 7 +++++-- graph/resolvers/root_mutation.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index 3773a8dde..f63951812 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -277,7 +277,10 @@ const setStatus = async (ctx, { id, status }) => { * @param {Object} edit describes how to edit the comment * @param {String} edit.body the new Comment body */ -const edit = async (ctx, { id, asset_id, edit: { body, metadata = {} } }) => { +const editComment = async ( + ctx, + { id, asset_id, edit: { body, metadata = {} } } +) => { const { connectors: { services: { Moderation } } } = ctx; // Build up the new comment we're setting. We need to check this with @@ -324,7 +327,7 @@ module.exports = ctx => { } if (ctx.user && ctx.user.can(EDIT_COMMENT)) { - mutators.Comment.edit = action => edit(ctx, action); + mutators.Comment.edit = action => editComment(ctx, action); } return mutators; diff --git a/graph/resolvers/root_mutation.js b/graph/resolvers/root_mutation.js index ef583e06c..de2161a9e 100644 --- a/graph/resolvers/root_mutation.js +++ b/graph/resolvers/root_mutation.js @@ -13,10 +13,10 @@ const RootMutation = { }, editComment: async ( _, - { id, asset_id, edit: { body, metadata } }, + { id, asset_id, edit }, { mutators: { Comment } } ) => ({ - comment: await Comment.edit({ id, asset_id, edit: { body, metadata } }), + comment: await Comment.edit({ id, asset_id, edit }), }), createFlag: async ( _,