Skip to content

Commit ca16d28

Browse files
committed
PR review
1 parent ef5e786 commit ca16d28

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/common/SPEntities.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Represents SP List ContentType
99
*/
10-
export interface ISPContentType {
10+
export interface ISPListContentType {
1111
Id: ISPContentTypeId;
1212
Name?: string;
1313
Description?: string;
@@ -19,6 +19,10 @@ export interface ISPContentType {
1919
DocumentTemplateUrl?: string;
2020
SchemaXml?: string;
2121
}
22+
23+
// Alias for ISPListContentType
24+
export interface ISPContentType extends ISPListContentType {}
25+
2226
/**
2327
* Represents SP List
2428
*/

src/controls/contentTypePicker/ContentTypePicker.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import React from 'react';
33
import { IContentTypePickerProps, IContentTypePickerState } from './IContentTypePicker';
44
import { ISPService } from '../../services/ISPService';
55
import { SPServiceFactory } from '../../services/SPServiceFactory';
6-
import { cloneDeep } from 'lodash';
7-
import { Dropdown, IDropdownOption, IDropdownProps, Spinner, SpinnerSize } from 'office-ui-fabric-react';
6+
import cloneDeep from 'lodash/cloneDeep';
7+
import { Dropdown, IDropdownOption, IDropdownProps } from 'office-ui-fabric-react/lib/Dropdown';
8+
import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner';
89

910
const EMPTY_CONTENTTYPE_KEY = 'NO_CONTENTTYPE_SELECTED';
1011

src/services/SPService.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ export default class SPService implements ISPService {
2323

2424
public async getContentTypes(options?: IContentTypesOptions): Promise<ISPContentType[]> {
2525
try {
26-
let queryUrlString: string = `${this._webAbsoluteUrl}/_api/web`;
27-
if (options.listId) {
28-
queryUrlString += `/lists('${options.listId}')`;
29-
}
30-
queryUrlString += `/ContentTypes?`;
31-
26+
const queryUrlString: string = options.listId ? `${this._webAbsoluteUrl}/_api/web/lists('${options.listId}')/ContentTypes?` : `${this._webAbsoluteUrl}/_api/web/ContentTypes?`;
3227
const queryUrl = new URL(queryUrlString);
3328

3429
if (options.orderBy) {

0 commit comments

Comments
 (0)