Backup error for blank name field

This commit is contained in:
Ben Grant 2021-06-16 00:30:19 +10:00
parent 3e554043de
commit f16b158c7f
2 changed files with 7 additions and 0 deletions

View file

@ -23,6 +23,7 @@
"timezone": "Your time zone",
"errors": {
"name_required": "Your name is needed to store your availability.",
"password_incorrect": "Password is incorrect. Check your name is spelled right.",
"unknown": "Failed to login. Please try again."
},

View file

@ -226,8 +226,14 @@ const Event = (props) => {
}, [timezone]);
const onSubmit = async data => {
if (!data.name || data.name.length === 0) {
setFocus('name');
return setError(t('event:form.errors.name_required'));
}
setIsLoginLoading(true);
setError(null);
try {
const response = await api.post(`/event/${id}/people/${data.name}`, {
person: {