mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-23 09:40:39 +00:00
frontend validation of team members limitation
This commit is contained in:
@@ -153,28 +153,23 @@
|
||||
})
|
||||
},
|
||||
addMember() {
|
||||
let email = this.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)[0]
|
||||
|
||||
if (!email) {
|
||||
if (this.$isInvalidEmail(this.email)) {
|
||||
this.$refs.teamFolderForm.setErrors({
|
||||
'Email': this.$t("You have to type valid email")
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Get team folder limitations
|
||||
let limit = this.user.data.meta.limitations.max_team_members
|
||||
|
||||
if (limit.percentage >= 100 && ! limit.meta.allowed_emails.includes(email)) {
|
||||
if ( this.$cantInviteMember(this.email, this.invitations) ) {
|
||||
this.$refs.teamFolderForm.setErrors({
|
||||
'Email': this.$t("You have to upgrade your account to add this new member.")
|
||||
});
|
||||
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
this.$refs.teamFolderForm.reset()
|
||||
|
||||
this.invitations.push({
|
||||
this.invitations.unshift({
|
||||
type: 'invitation',
|
||||
email: this.email,
|
||||
permission: 'can-edit',
|
||||
|
||||
Reference in New Issue
Block a user