Backup error for blank name field
This commit is contained in:
parent
3e554043de
commit
f16b158c7f
|
|
@ -23,6 +23,7 @@
|
||||||
"timezone": "Your time zone",
|
"timezone": "Your time zone",
|
||||||
|
|
||||||
"errors": {
|
"errors": {
|
||||||
|
"name_required": "Your name is needed to store your availability.",
|
||||||
"password_incorrect": "Password is incorrect. Check your name is spelled right.",
|
"password_incorrect": "Password is incorrect. Check your name is spelled right.",
|
||||||
"unknown": "Failed to login. Please try again."
|
"unknown": "Failed to login. Please try again."
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -226,8 +226,14 @@ const Event = (props) => {
|
||||||
}, [timezone]);
|
}, [timezone]);
|
||||||
|
|
||||||
const onSubmit = async data => {
|
const onSubmit = async data => {
|
||||||
|
if (!data.name || data.name.length === 0) {
|
||||||
|
setFocus('name');
|
||||||
|
return setError(t('event:form.errors.name_required'));
|
||||||
|
}
|
||||||
|
|
||||||
setIsLoginLoading(true);
|
setIsLoginLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await api.post(`/event/${id}/people/${data.name}`, {
|
const response = await api.post(`/event/${id}/people/${data.name}`, {
|
||||||
person: {
|
person: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue