единоразовая логика отправки данных ФК
This commit is contained in:
parent
04b3f779c3
commit
efb54852d8
@ -119,6 +119,7 @@ export const ContactForm = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const inputHC = async () => {
|
const inputHC = async () => {
|
||||||
|
console.log
|
||||||
const FC = settings?.cfg.formContact.fields || settings?.cfg.formContact;
|
const FC = settings?.cfg.formContact.fields || settings?.cfg.formContact;
|
||||||
const body = {};
|
const body = {};
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
@ -283,18 +284,6 @@ export const ContactForm = ({
|
|||||||
phone.length > 0 ||
|
phone.length > 0 ||
|
||||||
text.length > 0 ||
|
text.length > 0 ||
|
||||||
adress.length > 0
|
adress.length > 0
|
||||||
) {
|
|
||||||
try {
|
|
||||||
await inputHC();
|
|
||||||
fireOnce.current = false;
|
|
||||||
enqueueSnackbar("Данные успешно отправлены");
|
|
||||||
} catch (e) {
|
|
||||||
enqueueSnackbar("повторите попытку позже");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
settings?.cfg.resultInfo.showResultForm === "after" &&
|
|
||||||
!checkEmptyData({ resultData: resultQuestion })
|
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
await inputHC();
|
await inputHC();
|
||||||
@ -323,9 +312,7 @@ export const ContactForm = ({
|
|||||||
setShowContactForm(false);
|
setShowContactForm(false);
|
||||||
setShowResultForm(true);
|
setShowResultForm(true);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
enqueueSnackbar("Пожалуйста, заполните поля");
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
enqueueSnackbar("Пожалуйста, заполните поля");
|
enqueueSnackbar("Пожалуйста, заполните поля");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user