Skip to content

Commit 173e398

Browse files
committed
Merge branch 'people-picker-source-site' of https://github.com/joelfmrodrigues/sp-dev-fx-controls-react into joelfmrodrigues-people-picker-source-site
2 parents de5c10a + 2a51cf5 commit 173e398

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/controls/peoplepicker/IPeoplePicker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export interface IPeoplePickerProps {
1414
* Text of the Control
1515
*/
1616
titleText: string;
17+
/**
18+
* Web Absolute Url of source site
19+
*/
20+
webAbsoluteUrl?: string;
1721
/**
1822
* Whether the control is enabled or not
1923
*/

src/controls/peoplepicker/PeoplePickerComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
143143
stringVal = "/_api/web/siteusers";
144144
}
145145

146+
const webAbsoluteUrl = this.props.webAbsoluteUrl || this.props.context.pageContext.web.absoluteUrl;
146147
// Create the rest API
147-
const restApi = `${this.props.context.pageContext.web.absoluteUrl}${stringVal}`;
148+
const restApi = `${webAbsoluteUrl}${stringVal}`;
148149

149150
try {
150151
// Call the API endpoint

0 commit comments

Comments
 (0)