Fix params for moduserflaggedquery.

This commit is contained in:
gaba
2017-03-23 14:48:15 -07:00
parent d9af09d2a3
commit b9c816285d
3 changed files with 24 additions and 17 deletions
@@ -7,13 +7,15 @@ const lang = new I18n(translations);
import styles from './Community.css';
import Loading from './Loading';
import EmptyCard from '../../components/EmptyCard';
import EmptyCard from 'coral-admin/src/components/EmptyCard';
import User from './components/User';
const FlaggedAccounts = ({...props}) => {
const {commenters, isFetching} = props;
const hasResults = !isFetching && commenters && !!commenters.length;
// if (commenter.status === 'PENDING' && commenter.actions.length > 0) {
return (
<div className={styles.container}>
<div className={styles.mainFlaggedContent}>
@@ -21,19 +23,16 @@ const FlaggedAccounts = ({...props}) => {
{
hasResults
? commenters.map((commenter, index) => {
if (commenter.status === 'PENDING' && commenter.actions.length > 0) {
return <User
user={commenter}
key={index}
index={index}
modActionButtons={['REJECT', 'APPROVE']}
showBanUserDialog={props.showBanUserDialog}
showSuspendUserDialog={props.showSuspendUserDialog}
approveUser={props.approveUser}
suspendUser={props.suspendUser}
/>;
}
return null;
return <User
user={commenter}
key={index}
index={index}
modActionButtons={['APPROVE', 'REJECT']}
showBanUserDialog={props.showBanUserDialog}
showSuspendUserDialog={props.showSuspendUserDialog}
approveUser={props.approveUser}
suspendUser={props.suspendUser}
/>;
})
: <EmptyCard>{lang.t('community.no-flagged-accounts')}</EmptyCard>
}
@@ -67,7 +67,15 @@ export const loadMore = (fetchMore) => ({limit, cursor, sort, tab, asset_id}) =>
});
};
export const modUserFlaggedQuery = graphql(MOD_USER_FLAGGED_QUERY);
export const modUserFlaggedQuery = graphql(MOD_USER_FLAGGED_QUERY, {
options: ({params: {action_type = 'FLAG'}}) => {
return {
variables: {
action_type: action_type
}
};
}
});
export const modQueueResort = (id, fetchMore) => (sort) => {
return fetchMore({
@@ -1,5 +1,5 @@
query Users ($n: ACTION_TYPE) {
users (query:{action_type: $n}){
query Users ($action_type: ACTION_TYPE) {
users (query:{action_type: $action_type}){
id
username
status