From 6f7600fca2e5254d037dff22d67d4f6c3da02ef0 Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 10 Jul 2015 15:52:09 +0200 Subject: [PATCH] login errors + request obfuscated --- .../accordion_list_item_create_editions.js | 9 +++------ js/components/password_reset_container.js | 8 ++++---- js/components/register_piece.js | 9 +++------ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js index 8a1c8ace..30a6efbc 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js @@ -16,12 +16,9 @@ let AccordionListItemCreateEditions = React.createClass({ }, getFormData(){ - let data = {}; - for (let ref in this.refs.form.refs){ - data[this.refs.form.refs[ref].props.name] = this.refs.form.refs[ref].state.value; - } - data.piece_id = parseInt(this.props.pieceId, 10); - return data; + return { + piece_id: parseInt(this.props.pieceId, 10) + }; }, render() { diff --git a/js/components/password_reset_container.js b/js/components/password_reset_container.js index 43501436..20a35b16 100644 --- a/js/components/password_reset_container.js +++ b/js/components/password_reset_container.js @@ -105,10 +105,10 @@ let PasswordResetForm = React.createClass({ mixins: [Router.Navigation], getFormData(){ - let data = {}; - data.email = this.props.email; - data.token = this.props.token; - return data; + return { + email: this.props.email, + token: this.props.token + }; }, handleSuccess() { this.transitionTo('pieces'); diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 045ba06e..f0dd1e02 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -98,12 +98,9 @@ let RegisterPiece = React.createClass( { }, getFormData(){ - let data = {}; - for (let ref in this.refs.form.refs){ - data[this.refs.form.refs[ref].props.name] = this.refs.form.refs[ref].state.value; - } - data.digital_work_key = this.state.digitalWorkKey; - return data; + return { + digital_work_key: this.state.digitalWorkKey + }; }, submitKey(key){