Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-gravity-form

Package Overview
Dependencies
Maintainers
1
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-gravity-form - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

23

index.js

@@ -7,2 +7,3 @@ import React, { Component } from "react";

import Submit from "./FormElements/Submit";
import axios from "axios";

@@ -32,9 +33,5 @@ class GravityForm extends Component {

this._isMounted = true;
const form = await fetch(`${backendUrl}/v1/gravityforms/${formID}`)
.then(response => {
if (response.ok) {
return response.json();
}
throw new Error();
})
const form = await axios
.get(`${backendUrl}/v1/gravityforms/${formID}`)
.then(response => response.data)
.catch(() => false);

@@ -194,16 +191,14 @@

const data = new FormData(event.target);
const req = await fetch(
const response = await axios.post(
`${backendUrl}/v1/gravityforms/${formID}/submissions`,
{
method: "POST",
body: data
data
}
);
const response = await req.json();
if (response.is_valid) {
if (response.data && response.is_valid) {
this.setState({
submitting: false,
submitSuccess: true,
confirmationMessage: response.confirmation_message
confirmationMessage: response.data.confirmation_message
});

@@ -214,3 +209,3 @@ } else {

submitFailed: true,
errorMessages: response.validation_messages
errorMessages: response.data.validation_messages
});

@@ -217,0 +212,0 @@ }

{
"name": "react-gravity-form",
"version": "0.0.4",
"version": "0.0.5",
"description": "A component for including Gravity Forms on React apps via the Wordpress API",

@@ -29,4 +29,5 @@ "main": "index.js",

"devDependencies": {
"react": "^16.8.1"
"react": "^16.8.1",
"axios": "^0.19.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc