Change code formatting to satisfy Hound
This commit is contained in:
parent
b300049e1e
commit
fd3085e1f1
44
js/api.js
44
js/api.js
|
|
@ -345,29 +345,29 @@ const reducer_tournamentinfo = (state = defaultstate_tournamentinfo, action) =>
|
||||||
|
|
||||||
const reducer_tournamentlist = (state = defaultstate_tournamentlist, action) => {
|
const reducer_tournamentlist = (state = defaultstate_tournamentlist, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case actiontypes_tournamentlist.FETCH:
|
case actiontypes_tournamentlist.FETCH:
|
||||||
getRequest(action.state, '/tournaments?type=' + action.parameters.type).then((resp) => {
|
getRequest(action.state, '/tournaments?type=' + action.parameters.type).then((resp) => {
|
||||||
__store.dispatch({
|
__store.dispatch({
|
||||||
type: actiontypes_tournamentlist.FETCH_SUCCESS,
|
type: actiontypes_tournamentlist.FETCH_SUCCESS,
|
||||||
parameters: resp.data
|
parameters: resp.data
|
||||||
});
|
|
||||||
storeOptionalToken(resp);
|
|
||||||
action.parameters.successCallback(resp.data);
|
|
||||||
}).catch((error) => {
|
|
||||||
__store.dispatch({
|
|
||||||
type: actiontypes_tournamentlist.FETCH_ERROR,
|
|
||||||
parameters: {error: error}
|
|
||||||
});
|
|
||||||
storeOptionalToken(error.response);
|
|
||||||
action.parameters.errorCallback();
|
|
||||||
});
|
});
|
||||||
return state;
|
storeOptionalToken(resp);
|
||||||
case actiontypes_tournamentlist.FETCH_SUCCESS:
|
action.parameters.successCallback(resp.data);
|
||||||
return Object.assign({}, state, {tournaments: action.parameters});
|
}).catch((error) => {
|
||||||
case actiontypes_tournamentlist.FETCH_ERROR:
|
__store.dispatch({
|
||||||
return state;
|
type: actiontypes_tournamentlist.FETCH_ERROR,
|
||||||
default:
|
parameters: {error: error}
|
||||||
return state;
|
});
|
||||||
|
storeOptionalToken(error.response);
|
||||||
|
action.parameters.errorCallback();
|
||||||
|
});
|
||||||
|
return state;
|
||||||
|
case actiontypes_tournamentlist.FETCH_SUCCESS:
|
||||||
|
return Object.assign({}, state, {tournaments: action.parameters});
|
||||||
|
case actiontypes_tournamentlist.FETCH_ERROR:
|
||||||
|
return state;
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,15 @@ export default class TournamentList extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
requestTournamentList(this.props.type, tournaments => {
|
requestTournamentList(this.props.type, tournaments => {
|
||||||
this.setState({
|
this.setState({
|
||||||
tournaments: tournaments
|
tournaments: tournaments
|
||||||
});
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
this.setState({
|
|
||||||
error
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
this.setState({
|
||||||
|
error
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue