mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Standardized metadata
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 (
|
||||
_,
|
||||
|
||||
Reference in New Issue
Block a user