Show a warning if the user cannot create more aliases

This commit is contained in:
Adrià Casajús 2022-02-15 18:50:09 +01:00
parent c947e7cbd5
commit 92ec70c497
No known key found for this signature in database
GPG key ID: F0033226A5AFC9B9

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");
}
}
}