Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private _getListData(listName: string): Promise<ISPLists> {
- const queryString: string = '$select=Title,ID,Created,Author/ID,Author/Title&$expand=Author/ID,Author/Title&$Orderby=SortOrder';
- return this.context.spHttpClient
- .get(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists/GetByTitle('${listName}')/items`,//?${queryString}`,
- SPHttpClient.configurations.v1)
- .then((response: SPHttpClientResponse) => {
- if (response.status === 404) {
- Log.error('js-display-List', new Error('List not found.'));
- return [];
- }else {
- return response.json();
- }
- });
- }
Add Comment
Please, Sign In to add comment