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

View File

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