registration fixed/reworked

This commit is contained in:
rchrist 2019-05-09 19:13:34 +02:00
parent cbc448b048
commit d88d7baf09
2 changed files with 10 additions and 10 deletions

View File

@ -107,12 +107,12 @@
class=""
expand-icon-toggle
expand-separator
icon="location_on"
:label="teamInvite.teamName"
caption="Tritt diesem Team bei"
icon="group"
:label="teamInvite.team.name"
:caption="teamInvite.team.teamStatus"
>
<q-item class="q-pr-sm reverse q-gutter-x-sm">
<q-btn @click="joinTeam(teamInvite.id)" unelevated color="positive" stack icon="arrow_forward"
<q-btn @click="joinTeam(teamInvite.team.id)" unelevated color="positive" stack icon="arrow_forward"
label="Anfrage annehmen" size="sm"/>
<q-btn @click="deleteTeamInvite(teamInvite.id)" unelevated color="negative" stack icon="delete"
label="Anfrage ablehnen" size="sm"/>
@ -407,14 +407,14 @@
})
},
joinTeam(inviteId) {
let params;
let params = {};
if (localStorage.getItem('userToken')) {
params.token = JSON.parse(localStorage.getItem('userToken')).token;
} else {
return;
}
params.teamID = inviteId;
this.$axios.put('/api/joinTeam', {params: {params}})
this.$axios.put('/api/joinTeam', null, {params})
.then((response) => {
console.log(response.data);
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {
@ -427,21 +427,21 @@
})
},
deleteTeamInvite(inviteId) {
let params;
let params = {};
if (localStorage.getItem('userToken')) {
params.token = JSON.parse(localStorage.getItem('userToken')).token;
} else {
return;
}
params.teamInviteID = inviteId;
this.$axios.delete('/api/deleteTeamInvite', {params: {params}})
this.$axios.delete('/api/deleteTeamInvite', {params})
.then((response) => {
console.log(response.data);
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {
message: "Du hast die Anfrage von Team " + response.data.teamName + " gelöscht!",
title: "Teambeitrittsanfrage",
color: "blue"
});
this.getTeamData();
}).catch((error) => {
this.handleError(error);
})

View File

@ -81,7 +81,7 @@
},
computed: {
validationSuccesful() {
if (this.user.name >= 2
if (this.user.name.length >= 2
&& this.validateEmail(this.user.email)
&& this.user.email === this.user.checkemail
&& this.user.password.length >= 8