diff --git a/samples/sharepoint-crud/src/webparts/angularCrud/app/DataService.ts b/samples/sharepoint-crud/src/webparts/angularCrud/app/DataService.ts index c45c591d4..7b3fccdcb 100644 --- a/samples/sharepoint-crud/src/webparts/angularCrud/app/DataService.ts +++ b/samples/sharepoint-crud/src/webparts/angularCrud/app/DataService.ts @@ -158,12 +158,7 @@ export default class DataService implements IDataService { public deleteItem(item: IListItem, webUrl: string, listName: string): ng.IPromise<{}> { const deferred: ng.IDeferred<{}> = this.$q.defer(); - let listItemEntityTypeName: string = undefined; - this.getListItemEntityTypeName(webUrl, listName) - .then((typeName: string): ng.IPromise> => { - listItemEntityTypeName = typeName; - return this.getRequestDigest(webUrl); - }) + this.getRequestDigest(webUrl) .then((requestDigest: string): ng.IPromise> => { return this.$http({ url: `${webUrl}/_api/web/lists/getbytitle('${listName}')/items(${item.Id})`, diff --git a/samples/sharepoint-crud/src/webparts/noFrameworkCrud/NoFrameworkCrudWebPart.ts b/samples/sharepoint-crud/src/webparts/noFrameworkCrud/NoFrameworkCrudWebPart.ts index ea90bbaf5..a99042de5 100644 --- a/samples/sharepoint-crud/src/webparts/noFrameworkCrud/NoFrameworkCrudWebPart.ts +++ b/samples/sharepoint-crud/src/webparts/noFrameworkCrud/NoFrameworkCrudWebPart.ts @@ -281,12 +281,7 @@ export default class NoFrameworkCrudWebPart extends BaseClientSideWebPart => { - listItemEntityTypeName = listItemType; - return this.getLatestItemId(); - }) + this.getLatestItemId() .then((itemId: number): Promise => { if (itemId === -1) { throw new Error('No items found in the list'); diff --git a/samples/sharepoint-crud/src/webparts/reactCrud/components/ReactCrud.tsx b/samples/sharepoint-crud/src/webparts/reactCrud/components/ReactCrud.tsx index d8260cb53..eb88c10b6 100644 --- a/samples/sharepoint-crud/src/webparts/reactCrud/components/ReactCrud.tsx +++ b/samples/sharepoint-crud/src/webparts/reactCrud/components/ReactCrud.tsx @@ -97,9 +97,7 @@ export default class ReactCrud extends React.Component => { const body: string = JSON.stringify({ '__metadata': { - 'type': 'SP.Data.' + - this.props.listName.charAt(0).toUpperCase() + - this.props.listName.slice(1) + 'ListItem' + 'type': listItemEntityTypeName }, 'Title': `Item ${new Date()}` }); @@ -124,7 +122,7 @@ export default class ReactCrud extends React.Component => { - listItemEntityTypeName = listItemType; - return this.getLatestItemId(); - }) + this.getLatestItemId() .then((itemId: number): Promise => { if (itemId === -1) { throw new Error('No items found in the list');