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

How to get specific version of item? #827

Closed
vincent-chan-hk opened this issue Jul 6, 2018 · 3 comments
Closed

How to get specific version of item? #827

vincent-chan-hk opened this issue Jul 6, 2018 · 3 comments

Comments

@vincent-chan-hk
Copy link

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the Developer Guide to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.

Category

[ ] Enhancement

[X ] Bug

[X ] Question

Version

Please specify what version of the library you are using: [ 3.0.7 ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

I found that it should have method of getting specific version of item (added support for additional file version methods and added support f… #651). But I cannot find out how to use this method in existing documentation. Please teach me! Thanks!

If you are reporting an issue please describe the expected behavior. If you are suggesting an enhancement please
describe thoroughly the enhancement, how it can be achieved, and expected benefit. If you are asking a question, ask away!

Observed Behavior

If you are reporting an issue please describe the behavior you expected to occur when performing the action. If you are making a
suggestion or asking a question delete this section.

Steps to Reproduce

If you are reporting an issue please describe the steps to reproduce the bug in sufficient detail to allow testing. If you are making
a suggestion or asking a question delete this section.

Submission Guidelines

Delete this section after reading

  • All suggestions, questions, and issues are welcome, please let us know what's on your mind.
  • If you have a general question gitter may be a better forum.
  • Remember to include sufficient details and context.
  • If you have multiple suggestions, questions, or bugs please submit them in separate issues so we can track resolution.

Thanks!

@koltyakov
Copy link
Collaborator

koltyakov commented Jul 6, 2018

Hi @vincent-chan-hk,

You can get item's version using item.version method, or item.versions.getById for a specific version.
Though, it'll work in SPO as versions API landed to REST not far ago.

item.versions.get().then(console.log); // all versions info
item.versions.getById(512).get().then(console.log); // a specific version

image


Thank you for your interest in the sp-pnp-js library. We wanted to mention that this library is being deprecated in July 2018 in favor of the new scoped pnpjs libraries. You should begin transitioning your existing projects when possible or start new projects with the new libraries. Please see the transition guide for more details on migrating and be sure to let us know if you have any questions. Thanks!

@vincent-chan-hk
Copy link
Author

Thank you for your quick response! You save my Happy Friday! I completed my coding and I can have a drink in Lan Kwai Fong. :)
Happy Friday!

@koltyakov
Copy link
Collaborator

koltyakov commented Jul 6, 2018

Cheers, buddy!

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

No branches or pull requests

2 participants