Merge pull request #1211 from coralproject/premod-admin-comments

Fix new admin comments not showing up in premod
This commit is contained in:
Kim Gardner
2017-12-18 16:44:15 -06:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
@@ -193,7 +193,12 @@ export default {
},
updateQueries: {
CoralEmbedStream_Embed: (prev, {mutationResult: {data: {createComment: {comment}}}}) => {
if (prev.asset.settings.moderation === 'PRE' || comment.status === 'PREMOD' || comment.status === 'REJECTED' || comment.status === 'SYSTEM_WITHHELD') {
if (
prev.me.roles.indexOf('ADMIN') === -1 && prev.asset.settings.moderation === 'PRE' ||
comment.status === 'PREMOD' ||
comment.status === 'REJECTED' ||
comment.status === 'SYSTEM_WITHHELD'
) {
return prev;
}
return insertCommentIntoEmbedQuery(prev, comment);
@@ -285,6 +285,7 @@ const fragments = {
ignoredUsers {
id
}
roles
}
settings {
organizationName