add users and fix modal
This commit is contained in:
@@ -51,7 +51,7 @@ export default function FormModal({
|
||||
|
||||
useEffect(() => {
|
||||
if (currentForm) {
|
||||
form.initialize({
|
||||
form.setValues({
|
||||
...currentForm,
|
||||
start: currentForm.start || null,
|
||||
end: currentForm.end || null,
|
||||
@@ -93,6 +93,7 @@ export default function FormModal({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
size="50%"
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
title={currentForm ? t("edit form") : t('create form')}
|
||||
@@ -206,8 +207,10 @@ export default function FormModal({
|
||||
aria-label={currentForm ? t("edit form", {capfirst: true}) : t('create form', {capfirst: true})}
|
||||
onClick={() => {
|
||||
form.validate();
|
||||
if (form.isValid())
|
||||
if (form.isValid()) {
|
||||
handleSubmit(form.getValues(), currentForm?.id)
|
||||
form.reset();
|
||||
}
|
||||
}}
|
||||
>{currentForm ? t("edit form", {capfirst: true}) : t('create form', {capfirst: true})}</Button>
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user