Merge branch 'master' into ticket/TURNIERE-236

This commit is contained in:
betanummeric 2019-06-18 21:27:26 +02:00 committed by GitHub
commit 34f4eb9fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View File

@ -184,7 +184,7 @@ const reducerTournamentinfo = (state = defaultStateTournamentinfo, action) => {
case actionTypesTournamentinfo.CREATE_TOURNAMENT:
postRequest(action.state, '/tournaments', action.parameters.tournament).then(resp => {
storeOptionalToken(resp);
action.parameters.successCallback();
action.parameters.successCallback(resp.data);
}).catch(error => {
if (error.response) {
storeOptionalToken(error.response);

View File

@ -21,6 +21,7 @@ import {Footer} from '../js/components/Footer';
import EditableStringList from '../js/components/EditableStringList';
import {createTournament} from '../js/api';
import {WarningPopup} from '../js/components/WarningPopup';
import Router from 'next/router';
import '../static/css/everypage.css';
import RequireLogin from '../js/components/RequireLogin';
@ -216,8 +217,8 @@ class CreateTournamentForm extends React.Component {
create() {
if (this.valuesAreCredible()) {
createTournament(this.generateTournamentCreationObject(), () => {
notify.show('Das Turnier wurde erfolgreich erstellt.', 'success', 5000);
createTournament(this.generateTournamentCreationObject(), data => {
Router.push('/t/' + data.id);
}, () => {
notify.show('Das Turnier konnte nicht erstellt werden.', 'warning', 5000);
});

View File

@ -38,7 +38,8 @@ function PublicTournaments(props) {
<PublicTournamentsCard/>
</Container>
<Container className="pb-5 pt-3">
<a href='/private' className="btn btn-success shadow">zu den privaten Turnieren</a>
<a href='/private' className="btn btn-primary shadow">zu den privaten Turnieren</a>
<a href='/create' className="ml-3 btn btn-success shadow">neues Turnier erstellen</a>
</Container>
</div>);
} else {

View File

@ -19,7 +19,7 @@ class PrivateTournamentsPage extends React.Component {
<title>Private Turniere: turnie.re</title>
</Head>
<TurniereNavigation/>
<PrivateTournamentsPageContent/>
<PrivateTournamentsPageContent isSignedIn={this.props.isSignedIn}/>
<Footer/>
</div>
</RequireLogin>);
@ -35,13 +35,14 @@ const PrivateTournamentListPage = connect(mapStateToProperties)(PrivateTournamen
export default PrivateTournamentListPage;
function PrivateTournamentsPageContent() {
function PrivateTournamentsPageContent(props) {
return (<div>
<Container className="pt-5">
<PrivateTournamentsCard/>
</Container>
<Container className="pb-5 pt-3">
<a href='/list' className="btn btn-success shadow">zu den öffentlichen Turnieren</a>
<a href='/list' className="btn btn-primary shadow">zu den öffentlichen Turnieren</a>
{props.isSignedIn && <a href='/create' className="ml-3 btn btn-success shadow">neues Turnier erstellen</a>}
</Container>
</div>);
}