mirror of
https://github.com/wassname/talk.git
synced 2026-09-13 13:10:43 +08:00
Merge branch 'master' into asset-graph-api
This commit is contained in:
@@ -5,7 +5,7 @@ const {ADD_COMMENT_TAG, REMOVE_COMMENT_TAG} = require('../../perms/constants');
|
||||
/**
|
||||
* Modifies the targeted model with the specified operation to add/remove a tag.
|
||||
*/
|
||||
const modify = async ({user, loaders: {Tags}, pubsub}, operation, {name, id, item_type, asset_id}) => {
|
||||
const modify = async ({user, loaders: {Tags}}, operation, {name, id, item_type, asset_id}) => {
|
||||
|
||||
// Get the global list of tags from the dataloader.
|
||||
const tags = await Tags.getAll.load({id, item_type, asset_id});
|
||||
|
||||
@@ -2,7 +2,7 @@ const errors = require('../../errors');
|
||||
const UsersService = require('../../services/users');
|
||||
const {SET_USER_STATUS, SUSPEND_USER, REJECT_USERNAME} = require('../../perms/constants');
|
||||
|
||||
const setUserStatus = async ({user, pubsub}, {id, status}) => {
|
||||
const setUserStatus = async ({pubsub}, {id, status}) => {
|
||||
const result = await UsersService.setStatus(id, status);
|
||||
if (result && result.status === 'BANNED') {
|
||||
pubsub.publish('userBanned', result);
|
||||
@@ -10,7 +10,7 @@ const setUserStatus = async ({user, pubsub}, {id, status}) => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const suspendUser = async ({user, pubsub}, {id, message, until}) => {
|
||||
const suspendUser = async ({pubsub}, {id, message, until}) => {
|
||||
const result = await UsersService.suspendUser(id, message, until);
|
||||
if (result) {
|
||||
pubsub.publish('userSuspended', result);
|
||||
@@ -18,7 +18,7 @@ const suspendUser = async ({user, pubsub}, {id, message, until}) => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const rejectUsername = async ({user, pubsub}, {id, message}) => {
|
||||
const rejectUsername = async ({pubsub}, {id, message}) => {
|
||||
const result = await UsersService.rejectUsername(id, message);
|
||||
if (result) {
|
||||
pubsub.publish('usernameRejected', result);
|
||||
|
||||
Reference in New Issue
Block a user