Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Bug in saveAuthor method of mockAuthorApi.js causes author.id to always be present, even during create actions #14

Closed
compumike08 opened this issue Jul 27, 2016 · 1 comment

Comments

@compumike08
Copy link
Contributor

Node version: 4.4.7

npm version: 2.15.8

Operating system: Windows 7 (64-bit)

Command line used: Git BASH for Windows

Steps to reproduce: When you add the ability to add authors to the react/redux code, your saveAuthor method in this repository's mockAuthorApi.js file doesn't make a local copy of the author object passed into it before manipulating it. This causes saveAuthor to manipulate the author object in the "client-side" code directly. If you try to create a new author, when the saveAuthor method in mockAuthorApi.js is invoked it will generate and add an id to the author object. But since it is manipulating the author object directly, the id gets added to the "client-side" author object and causes the "client-side" code to always think you are doing an update instead of a create action.

compumike08 added a commit to compumike08/pluralsight-redux-starter that referenced this issue Jul 27, 2016
coryhouse added a commit that referenced this issue Jul 27, 2016
@coryhouse
Copy link
Owner

Resolved with this PR: #16

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

No branches or pull requests

2 participants