diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js index 19ecb191a..50c0569ca 100644 --- a/public/react/src/modules/competition/Registration.js +++ b/public/react/src/modules/competition/Registration.js @@ -289,8 +289,35 @@ class Registration extends React.Component { } } else { - try { - if (result.data.competition_teams.length === 0) { + if (this.props.user.admin === true) { + try { + + if (result.data.competition_teams.length === 0) { + this.setState({ + type: 6, + typeysl: 1, + data: result.data.competition_teams, + count: result.data.count, + competition_teams: result.data.competition_teams, + personal: result.data.personal, + competition_name: result.data.competition_name, + members_count: result.data.members_count, + + }) + } else { + this.setState({ + type: 6, + typeysl: 0, + data: result.data.competition_teams, + count: result.data.count, + competition_teams: result.data.competition_teams, + personal: result.data.personal, + competition_name: result.data.competition_name, + members_count: result.data.members_count, + + }) + } + } catch (e) { this.setState({ type: 6, typeysl: 1, @@ -302,11 +329,40 @@ class Registration extends React.Component { members_count: result.data.members_count, }) - } else { + } + } else { + try { + + if (result.data.my_teams.length === 0) { + this.setState({ + type: 6, + typeysl: 1, + data: result.data.my_teams, + count: result.data.count, + competition_teams: result.data.competition_teams, + personal: result.data.personal, + competition_name: result.data.competition_name, + members_count: result.data.members_count, + + }) + } else { + this.setState({ + type: 6, + typeysl: 0, + data: result.data.my_teams, + count: result.data.count, + competition_teams: result.data.competition_teams, + personal: result.data.personal, + competition_name: result.data.competition_name, + members_count: result.data.members_count, + + }) + } + } catch (e) { this.setState({ type: 6, - typeysl: 0, - data: result.data.competition_teams, + typeysl: 1, + data: result.data.my_teams, count: result.data.count, competition_teams: result.data.competition_teams, personal: result.data.personal, @@ -315,19 +371,9 @@ class Registration extends React.Component { }) } - } catch (e) { - this.setState({ - type: 6, - typeysl: 1, - data: result.data.competition_teams, - count: result.data.count, - competition_teams: result.data.competition_teams, - personal: result.data.personal, - competition_name: result.data.competition_name, - members_count: result.data.members_count, - - }) } + + } } }