diff --git a/frontend/src/pages/Profile.vue b/frontend/src/pages/Profile.vue
index b6688af..8929eb2 100644
--- a/frontend/src/pages/Profile.vue
+++ b/frontend/src/pages/Profile.vue
@@ -57,7 +57,8 @@
- Neues Team erstellen
+ Neues Team erstellen
+ Neues Team erstellen
(Team verlassen um Option zu nutzen)
@@ -164,6 +165,7 @@
inviteMail: "",
currentTeamStatus: "",
teamStatus: "",
+ userName: "",
email: null,
userRanking: null,
teamName: null,
@@ -192,6 +194,10 @@
}
],
data: [
+ {
+ name: 'Benutzername',
+ userData: this.userName,
+ },
{
name: 'E-Mail',
userData: this.email,
@@ -290,8 +296,10 @@
created: function () {
this.$store.commit('auth/SET_AUTHENTICATED');
this.$store.commit('auth/SET_USER');
+ this.userName = JSON.parse(localStorage.getItem('userToken')).name;
+ this.data[0].userData = this.userName;
this.email = JSON.parse(localStorage.getItem('userMail'));
- this.data[0].userData = this.email;
+ this.data[1].userData = this.email;
this.getPersonalRanking();
this.getTeamData();
this.fetchTeamInvites();
@@ -302,11 +310,11 @@
return re.test(String(email).toLowerCase());
},
getPersonalRanking() {
- let name = this.email;
- this.$axios.get('/api/hello', {params: {name}})
+ let email = this.email;
+ this.$axios.get('/api/getRankingPlace', {params: {email}})
.then((response) => {
this.userRanking = response.data;
- this.data[1].userData = this.userRanking;
+ this.data[2].userData = this.userRanking;
}).catch((error) => {
this.handleError(error);
})
@@ -320,11 +328,12 @@
}
this.$axios.get('/api/getTeamOfUser', {params: {token}})
.then(response => {
- if (response.data.name === '') {
+ if (response.data === '') {
this.boolAlreadyInTeam = false;
this.teamName = "Aktuell in keinem Team";
this.currentTeamStatus = "";
this.teamRanking = "-";
+ this.dropDownSelectItem('Offene Teameinladungen');
} else {
this.boolAlreadyInTeam = true;
this.teamName = response.data.name;
@@ -332,9 +341,9 @@
//this.teamRanking = response.data.teamRanking;
this.fetchTeamMembers();
}
- this.data[2].userData = this.teamName;
+ this.data[3].userData = this.teamName;
this.dropDownSelectedItem = this.teamName;
- this.data[3].userData = this.teamRanking;
+ this.data[4].userData = this.teamRanking;
console.log("getTeam: " + response);
}).catch((error) => {
this.handleError(error);
@@ -398,8 +407,8 @@
}
this.$axios.get('/api/getMyTeamInvites', {params: {token}})
.then((response) => {
- console.log(response.data);
this.teamInvites = response.data;
+ console.log(this.teamInvites);
}).catch((error) => {
this.handleError(error);
})
@@ -445,16 +454,20 @@
})
},
sendTeamInvite() {
- let params;
+ let params = {};
if (localStorage.getItem('userToken')) {
params.token = JSON.parse(localStorage.getItem('userToken')).token;
} else {
return;
}
params.invitedUserEmail = this.inviteMail;
- this.$axios.post('/api/sendTeamInvite', {params: {params}})
+ this.$axios.post('/api/sendTeamInvite', null, {params})
.then((response) => {
- console.log(response.data);
+ this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {
+ message: "Du hast " + params.invitedUserEmail + " eingeladen!",
+ title: "Einladung ins Team",
+ color: "blue"
+ });
}).catch((error) => {
this.handleError(error);
})
@@ -469,7 +482,6 @@
params.teamStatus = this.teamStatus;
this.$axios.put('/api/setTeamStatus', null, {params})
.then((response) => {
- console.log(response.data);
this.getTeamData();
}).catch((error) => {
this.handleError(error);
diff --git a/frontend/src/pages/Register.vue b/frontend/src/pages/Register.vue
index 4a7b581..404948e 100644
--- a/frontend/src/pages/Register.vue
+++ b/frontend/src/pages/Register.vue
@@ -3,6 +3,14 @@