diff --git a/src/components/teams/EditTeam.vue b/src/components/teams/EditTeam.vue
index 4818e106..4c14da2b 100644
--- a/src/components/teams/EditTeam.vue
+++ b/src/components/teams/EditTeam.vue
@@ -15,6 +15,9 @@
+
@@ -142,7 +145,7 @@
import TeamModel from '../../models/team'
import TeamMemberService from '../../services/teamMember'
import TeamMemberModel from '../../models/teamMember'
-
+
export default {
name: "EditTeam",
data() {
@@ -156,6 +159,8 @@
showUserDeleteModal: false,
user: auth.user,
userIsAdmin: false,
+
+ showError: false,
}
},
beforeMount() {
@@ -193,6 +198,12 @@
})
},
submit() {
+ if (this.team.name.length <= 4) {
+ this.showError = true
+ return
+ }
+ this.showError = false
+
this.teamService.update(this.team)
.then(response => {
this.team = response
diff --git a/src/components/teams/NewTeam.vue b/src/components/teams/NewTeam.vue
index acc25663..5b74c9f0 100644
--- a/src/components/teams/NewTeam.vue
+++ b/src/components/teams/NewTeam.vue
@@ -8,7 +8,12 @@
@@ -35,6 +43,7 @@
return {
teamService: TeamService,
team: TeamModel,
+ showError: false,
}
},
beforeMount() {
@@ -50,9 +59,16 @@
},
methods: {
newTeam() {
+
+ if (this.team.name.length <= 4) {
+ this.showError = true
+ return
+ }
+ this.showError = false
+
this.teamService.create(this.team)
.then(response => {
- router.push({name:'editTeam', params:{id: response.id}})
+ router.push({name: 'editTeam', params: {id: response.id}})
this.success({message: 'The team was successfully created.'}, this)
})
.catch(e => {