Skip to content

Introduce util function to retrieve all SharePoint items #4014

@milanholemans

Description

@milanholemans

While we have our odata.getAllItems<T>(url) util function, this function doesn't work for SharePoint items.
Because SharePoint REST API uses odata v3 you'll get an error saying that the accept header is not valid.
However, we can tell the SharePoint REST API to use odata v4 which our util function is using. We can do this by adding a new header odata-version: 4.0.
By adding this header, we can use our util function for SharePoint REST API, Graph, ...

To do

  1. Add a new header odata-version: 4.0.

headers: {
accept: `application/json;odata.metadata=${metadata ?? 'none'}`
},

  1. Let's check which spo commands should be updated to use this util function.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions