From b6b6d902d124ab986767780a200bb9528fab0317 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Mar 2019 10:13:14 +0100 Subject: form stuff --- scraper/client/actions.js | 4 ++-- scraper/client/paper/paper.verify.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scraper/client/actions.js b/scraper/client/actions.js index 1f7baf97..6c4e16b2 100644 --- a/scraper/client/actions.js +++ b/scraper/client/actions.js @@ -33,11 +33,11 @@ export const postAddress = data => dispatch => { } export const getVerification = sha256 => dispatch => ( - api(dispatch, get, 'address', '/api/verify/' + sha256, {}) + api(dispatch, get, 'verify', '/api/verify/' + sha256, {}) ) export const postVerification = data => dispatch => ( - api(dispatch, post, 'address', '/api/verify/add', data) + api(dispatch, post, 'verify', '/api/verify/add', data) ) diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js index c2bf4b90..5f4a7240 100644 --- a/scraper/client/paper/paper.verify.js +++ b/scraper/client/paper/paper.verify.js @@ -32,23 +32,23 @@ class PaperVerify extends Component { componentDidUpdate(oldProps) { const { sha256 } = this.props.match.params - const { address } = this.props.api + const { verify } = this.props.api const { sha256: oldSha256 } = oldProps.match.params - const { address: oldAddress } = oldProps.api - const oldPaper = oldAddress ? oldAddress.paper : null - const paper = address ? address.paper : null + const { verify: oldVerify } = oldProps.api + const oldPaper = oldVerify ? oldVerify.paper : null + const paper = verify ? verify.paper : null if (oldSha256 && sha256 !== oldSha256) { - console.log('update address') + console.log('update verification') this.props.actions.getVerification(sha256) const citationState = this.getCitationState(sha256) this.setState({ ...initialState, ...citationState, }) - } else if (address && !address.loading && address.paper && (!oldPaper || oldPaper !== address.paper)) { + } else if (verify && !verify.loading && verify.paper && (!oldPaper || oldPaper !== verify.paper)) { if (paper.error) { - console.log('USING PAPER ADDRESS') + console.log('USING PAPER VERIFICATION') const citationState = this.getCitationState(sha256) this.setState({ ...initialState, -- cgit v1.2.3-70-g09d2