mirror of
https://github.com/wassname/talk.git
synced 2026-07-24 13:20:47 +08:00
Linting
This commit is contained in:
@@ -42,9 +42,8 @@ export const newPage = () => ({
|
||||
});
|
||||
|
||||
export const setRole = (id, role) => dispatch => {
|
||||
return fetch(`${base}/user/${id}/role`, getInit('POST', { role }))
|
||||
return fetch(`${base}/user/${id}/role`, getInit('POST', {role}))
|
||||
.then(() => {
|
||||
return dispatch({ type: SET_ROLE, id, role });
|
||||
})
|
||||
|
||||
}
|
||||
return dispatch({type: SET_ROLE, id, role});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { SelectField, Option } from 'react-mdl-selectfield';
|
||||
import React, {Component} from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {SelectField, Option} from 'react-mdl-selectfield';
|
||||
import styles from './Community.css';
|
||||
import I18n from 'coral-framework/i18n/i18n';
|
||||
import translations from '../../translations';
|
||||
import { setRole } from '../../actions/community';
|
||||
import {setRole} from '../../actions/community';
|
||||
|
||||
const lang = new I18n(translations);
|
||||
|
||||
@@ -20,7 +20,7 @@ class Table extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const { headers, commenters, onHeaderClickHandler } = this.props;
|
||||
const {headers, commenters, onHeaderClickHandler} = this.props;
|
||||
|
||||
return (
|
||||
<table className={`mdl-data-table ${styles.dataTable}`}>
|
||||
@@ -63,4 +63,4 @@ class Table extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(state => ({ commenters: state.community.get('commenters') }))(Table);
|
||||
export default connect(state => ({commenters: state.community.get('commenters')}))(Table);
|
||||
|
||||
@@ -38,11 +38,11 @@ export default function community (state = initialState, action) {
|
||||
})
|
||||
.set('commenters', commenters); // Sets to normal array
|
||||
}
|
||||
case SET_ROLE:
|
||||
case SET_ROLE :
|
||||
const commenters = state.get('commenters');
|
||||
const idx = commenters.findIndex(el => el.id === action.id);
|
||||
|
||||
commenters[idx].roles[0] = action.role
|
||||
commenters[idx].roles[0] = action.role;
|
||||
return state.set('commenters', commenters);
|
||||
case SORT_UPDATE :
|
||||
return state
|
||||
|
||||
Reference in New Issue
Block a user