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

Returning item instead of data for onSubmitted event #944

Merged
merged 1 commit into from
Jun 30, 2021
Merged

Returning item instead of data for onSubmitted event #944

merged 1 commit into from
Jun 30, 2021

Conversation

ravichandran-blog
Copy link
Contributor

Q A
Bugfix? [ X ]
New feature? [ ]
New sample? [ ]

What's in this Pull Request?

Returning item instead of data for the submitted event and some corrections in the documentation

Returning item instead of data for onSubmitted event and some corrections in the documentation
@AJIXuMuK
Copy link
Collaborator

Hi @ravichandran-blog,

I have intentionally changed the returning value from PnPJS item instance to the data.
Some developers may not use PnPJS and want just the data for the created/modified item. We, as a library, should support this scenario.

Potentially we can return the PnPJS item as a second parameter or based on additional property.
What do you think @joelfmrodrigues @estruyf ?

@joelfmrodrigues
Copy link
Collaborator

Sounds good to me 👍 Although everyone really should use PnPjs as it's great, it's their choice at the end of the day and I agree that we should not "enforce it".

@AJIXuMuK AJIXuMuK merged commit d1de207 into pnp:v2-dev Jun 30, 2021
@AJIXuMuK
Copy link
Collaborator

I have added a new property returnListItemInstanceOnSubmit. By default it is true.
If it is set the second parameter of onSubmitted will contain an instance of PnPJS IItem

This was referenced Aug 25, 2021
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

3 participants