Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug that parameter name gets not transformed to camelCase #37

Merged
merged 1 commit into from
Jul 29, 2018
Merged

Conversation

pgr86
Copy link
Contributor

@pgr86 pgr86 commented Jul 16, 2018

I found a small bug within the generated redux action code.

Our API consumes a user token via http header - we call it 'X-token'.
This is a mandatory param for our action.

The code generation will output something like this:

export function createUser(XToken, options, info) {
  return dispatch => {
    dispatch({ type: CREATE_USER_START, meta: { info } })
    return user.createUser(X-token, options)
      .then(response => dispatch({
        type: CREATE_USER,
        payload: response.data,
        error: response.error,
        meta: {
          res: response.raw,
          info
        }
      }))
  }
}

The param in the exported function will be correctly transformed from 'X-token' to XToken, but within the return statement the param name gets not transformed in this way. This will obviously throw an error.

@mikestead
Copy link
Owner

@pgr86 Thanks for raising the issue and providing a fix. Looks good but just want to give it a quick once over before merging. Hopefully get some time tomorrow.

@pgr86
Copy link
Contributor Author

pgr86 commented Jul 25, 2018

Hi Mike,
will you have the chance to review this pull request in the next days? I would really appreciate that. :-)

@mikestead mikestead merged commit dc75faf into mikestead:master Jul 29, 2018
@mikestead
Copy link
Owner

@pgr86 apologies for the delay, all works well, thanks for the fix 👍

@mikestead
Copy link
Owner

Released under v1.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants