Merge pull request #800 from acasajus/fix/support-new-alias-warning

Show a warning if the user cannot create more aliases
This commit is contained in:
Son Nguyen Kim 2022-02-15 19:36:32 +01:00 committed by GitHub
commit 88ed4b8d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -72,10 +72,14 @@
},
methods: {
generateRandomAlias: async function (event) {
let result = await fetch('/api/alias/random/new', {method: 'POST'})
let result = await fetch('/api/alias/random/new', {method: 'POST'});
if (result.ok) {
let data = await result.json();
this.ticket_email = data.alias;
} else if (result.status === 429 ){
toastr.warning("You've created too many aliases recently. Wait a bit before creating more");
} else {
toastr.warning("You can't create more aliases");
}
}
}