Standardized metadata

This commit is contained in:
Wyatt Johnson
2018-03-06 11:03:58 -07:00
parent 17f41fa5d0
commit 005602a738
2 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -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;
+2 -2
View File
@@ -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 (
_,