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

docs: fix example code for adding upload feature in DataProviders.md #2503

Merged
merged 1 commit into from
Nov 13, 2018

Conversation

misino
Copy link
Contributor

@misino misino commented Nov 5, 2018

No description provided.

if (params.data.pictures && params.data.pictures.length) {
// only freshly dropped pictures are instance of File
const formerPictures = params.data.pictures.filter(p.rawFile => !(p instanceof File));
const newPictures = params.data.pictures.filter(p.rawFile => p instanceof File);
const formerPictures = params.data.pictures.filter(p.rawFile => !(p.rawFile instanceof File));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be

-const formerPictures = params.data.pictures.filter(p.rawFile => !(p.rawFile instanceof File));
+const formerPictures = params.data.pictures.filter(p => !(p.rawFile instanceof File));

??

Copy link
Contributor Author

@misino misino Nov 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly! 👍 Updated the commit.

@fzaninotto fzaninotto merged commit 02b09dc into marmelab:master Nov 13, 2018
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the v2.4.3 milestone Nov 13, 2018
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.

None yet

2 participants