Skip to content

Commit a1718bc

Browse files
author
Ian Wensink
committed
fix(hn): post submissions to hn-endpoint
1 parent 43830b2 commit a1718bc

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"fetch-everywhere": "^1.0.5",
4646
"get-nested": "^4.0.0",
4747
"google_tag": "^1.1.1",
48+
"hn-react": "^1.2.1",
4849
"hot-formula-parser": "^2.2.0",
4950
"html-entities": "^1.2.1",
5051
"ibantools": "^1.3.0",

src/Webform/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
66
import React, { Component } from 'react';
77
import CSSModules from 'react-css-modules';
88
import Script from 'react-load-script';
9+
import { site } from 'hn-react';
910
import Forms from '../Observables/Forms';
1011
import Parser from '../Parser';
1112
import SubmitButton from '../SubmitButton';
@@ -36,7 +37,6 @@ class Webform extends Component {
3637
static propTypes = {
3738
settings: PropTypes.shape({
3839
title: PropTypes.string,
39-
cmsBaseUrl: PropTypes.string.isRequired,
4040
tracking: PropTypes.oneOfType([
4141
PropTypes.shape({
4242
gtm_id: PropTypes.oneOfType([
@@ -209,7 +209,7 @@ class Webform extends Component {
209209
if(!extraFields.in_draft) {
210210
this.setState({ status: Webform.formStates.PENDING });
211211
}
212-
return fetch(`${this.props.settings.cmsBaseUrl}/api/v1/form?_format=json`, {
212+
return fetch(`${site.url}/hn-webform-submission?_format=json`, {
213213
headers,
214214
method: 'POST',
215215
body: JSON.stringify(Object.assign({

yarn.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,13 @@ babel-runtime@6.x.x, babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@
13571357
core-js "^2.4.0"
13581358
regenerator-runtime "^0.10.0"
13591359

1360+
babel-runtime@^6.25.0:
1361+
version "6.26.0"
1362+
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
1363+
dependencies:
1364+
core-js "^2.4.0"
1365+
regenerator-runtime "^0.11.0"
1366+
13601367
babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.25.0, babel-template@^6.3.0:
13611368
version "6.25.0"
13621369
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071"
@@ -3566,6 +3573,14 @@ hmac-drbg@^1.0.0:
35663573
minimalistic-assert "^1.0.0"
35673574
minimalistic-crypto-utils "^1.0.1"
35683575

3576+
hn-react@^1.2.1:
3577+
version "1.2.1"
3578+
resolved "https://registry.yarnpkg.com/hn-react/-/hn-react-1.2.1.tgz#1ace79cad6eaae8a42ce46ffdc76fed4b40c436f"
3579+
dependencies:
3580+
babel-runtime "^6.25.0"
3581+
get-nested "^4.0.0"
3582+
prop-types "^15.5.10"
3583+
35693584
hoek@2.x.x:
35703585
version "2.16.3"
35713586
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
@@ -6537,6 +6552,10 @@ regenerator-runtime@^0.10.0:
65376552
version "0.10.5"
65386553
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
65396554

6555+
regenerator-runtime@^0.11.0:
6556+
version "0.11.0"
6557+
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1"
6558+
65406559
regenerator-runtime@^0.9.5:
65416560
version "0.9.6"
65426561
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.9.6.tgz#d33eb95d0d2001a4be39659707c51b0cb71ce029"

0 commit comments

Comments
 (0)