Skip to content

Commit

Permalink
Update: recaptchatoken
Browse files Browse the repository at this point in the history
  • Loading branch information
HeemahMuslad committed Jul 26, 2024
1 parent 6dfc9b4 commit d2a6cd5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/contact-us/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const ContactUsComponent = () => {

const { mutate: handleContactUs } = useMutation({
mutationFn: makeEnquiry,
onSuccess: (data) => {
onSuccess: () => {
toast.success("Message sent Successfully!", {
position: "top-right",
});
//
reset();
setRecaptchaToken("");
},
onError: (error, variables) => {
toast.error("An error occurred.", {
Expand All @@ -51,6 +51,10 @@ const ContactUsComponent = () => {
});

const onSubmit = (data) => {
if (!recaptchaToken) {
toast.error("Please complete the reCAPTCHA.", { position: toast.POSITION.TOP_RIGHT });
return;
}
handleContactUs(data);
};

Expand Down

0 comments on commit d2a6cd5

Please sign in to comment.