awsmin / frontity-wp-job-openings

Frontity package for WP Job Openings Plugin

Home Page:https://wpjobopenings.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Submission of form not working after deployed on vercel.

abhishekOptiphoenix opened this issue · comments

I deployed my frontity site in vercel. The submission of form is working on localhost:3000 but after deployment, the submit button stuck on "submitting...".

Screenshot 2022-03-15 at 12 33 27 PM

We use the admin-ajax.php URL for form submission. So, you may encounter the CORS Issue. An error: TypeError: NetworkError when attempting to fetch resource. will be thrown in the console and the Cross-Origin request will be blocked. This will prevent the form from submission. So you need to add the new location in allowed_http_origins filter hook.

If you are using WP Job Openings REST API Example plugin, you can add the new address here:
https://github.com/awsmin/wp-job-openings-rest-api-example/blob/265cf8b2c1f04abae0d198e844b8307a9855a459/rest-api.php#L86

Readme
https://github.com/awsmin/frontity-wp-job-openings#cors-issue

We use the admin-ajax.php URL for form submission. So, you may encounter the CORS Issue. An error: TypeError: NetworkError when attempting to fetch resource. will be thrown in the console and the Cross-Origin request will be blocked. This will prevent the form from submission. So you need to add the new location in allowed_http_origins filter hook.

If you are using WP Job Openings REST API Example plugin, you can add the new address here: https://github.com/awsmin/wp-job-openings-rest-api-example/blob/265cf8b2c1f04abae0d198e844b8307a9855a459/rest-api.php#L86

Readme https://github.com/awsmin/frontity-wp-job-openings#cors-issue

thanks, it worked after adding the filter hook in function.php.