Skip to content

Commit

Permalink
restore team dispatch when changing teams
Browse files Browse the repository at this point in the history
  • Loading branch information
cstns committed Dec 19, 2024
1 parent 5da7751 commit 923aab4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
14 changes: 8 additions & 6 deletions frontend/src/components/TeamSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ export default {
methods: {
selectTeam (team) {
if (team) {
this.$router.push({
name: 'Team',
params: {
team_slug: team.slug
}
})
this.$store.dispatch('account/setTeam', team.slug)
.then(() => this.$router.push({
name: 'Team',
params: {
team_slug: team.slug
}
}))
.catch(e => console.warn(e))
}
},
createTeam () {
Expand Down
14 changes: 8 additions & 6 deletions frontend/src/pages/account/Teams/Invitations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ export default {
await this.$store.dispatch('account/refreshTeams')
Alerts.emit(`Invite to "${invite.team.name}" has been accepted.`, 'confirmation')
// navigate to team dashboad once invite accepted
this.$router.push({
name: 'Team',
params: {
team_slug: invite.team.slug
}
})
this.$store.dispatch('account/setTeam', invite.team.slug)
.then(() => this.$router.push({
name: 'Team',
params: {
team_slug: invite.team.slug
}
}))
.catch(e => console.warn(e))
},
async rejectInvite (invite) {
await userApi.rejectTeamInvitation(invite.id, invite.team.id)
Expand Down
14 changes: 8 additions & 6 deletions frontend/src/pages/admin/Teams.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,14 @@ export default {
this.loading = false
},
viewTeam (row) {
this.$router.push({
name: 'Team',
params: {
team_slug: row.slug
}
})
this.$store.dispatch('account/setTeam', row.slug)
.then(() => this.$router.push({
name: 'Team',
params: {
team_slug: row.slug
}
}))
.catch(e => console.warn(e))
}
}
}
Expand Down

0 comments on commit 923aab4

Please sign in to comment.