Sends a mail to the suspended user.

This commit is contained in:
gaba
2017-03-21 15:08:46 -07:00
parent b9960c3cc7
commit 7522bd9cd6
12 changed files with 54 additions and 17 deletions
+5 -3
View File
@@ -6,9 +6,11 @@ const setUserStatus = ({user}, {id, status}) => {
.then(res => res);
};
const suspendUser = ({user}, {id}) => {
return UsersService.suspendUser(id)
.then(res => res);
const suspendUser = ({user}, {id, message}) => {
return UsersService.suspendUser(id, message)
.then(res => {
return res;
});
};
module.exports = (context) => {
+2 -2
View File
@@ -47,8 +47,8 @@ const RootMutation = {
setUserStatus(_, {id, status}, {mutators: {User}}) {
return wrapResponse(null)(User.setUserStatus({id, status}));
},
suspendUser(_, {id}, {mutators: {User}}) {
return wrapResponse(null)(User.suspendUser({id}));
suspendUser(_, {id, message}, {mutators: {User}}) {
return wrapResponse(null)(User.suspendUser({id, message}));
},
setCommentStatus(_, {id, status}, {mutators: {Comment}}) {
return wrapResponse(null)(Comment.setCommentStatus({id, status}));
+2 -2
View File
@@ -724,8 +724,8 @@ type RootMutation {
# Sets User status. Requires the `ADMIN` role.
setUserStatus(id: ID!, status: USER_STATUS!): SetUserStatusResponse
# Sets User status to BANNED and canEditName to true. Requires the `ADMIN` role.
suspendUser(id: ID!): SuspendUserResponse
# Sets User status to BANNED and canEditName to true. It sends a message to the banned User. Requires the `ADMIN` role.
suspendUser(id: ID!, message: String): SuspendUserResponse
# Sets Comment status. Requires the `ADMIN` role.
setCommentStatus(id: ID!, status: COMMENT_STATUS!): SetCommentStatusResponse