mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-03-08 21:01:46 +00:00
Added Service Interface
This commit is contained in:
parent
e370e40f8b
commit
36133a9c2b
9
samples/react-directory/src/SPServices/ISPServices.ts
Normal file
9
samples/react-directory/src/SPServices/ISPServices.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { PeoplePickerEntity } from '@pnp/sp';
|
||||
|
||||
export interface ISPServices {
|
||||
getUserProperties(user: string): Promise<any>;
|
||||
getUserProfileProperty(user: string, property: string): Promise<string>;
|
||||
getUsers(searchUser: string): Promise<PeoplePickerEntity[]>;
|
||||
searchUsers(searchString: string, searchFirstName: boolean);
|
||||
|
||||
}
|
@ -3,9 +3,10 @@ import { graph } from "@pnp/graph";
|
||||
import { sp, PeoplePickerEntity, ClientPeoplePickerQueryParameters, SearchQuery, SearchResults, SearchProperty, SortDirection } from '@pnp/sp';
|
||||
import { PrincipalType } from "@pnp/sp/src/sitegroups";
|
||||
import { isRelativeUrl } from "office-ui-fabric-react";
|
||||
import { ISPServices } from "./ISPServices";
|
||||
|
||||
|
||||
export class spservices {
|
||||
export class spservices implements ISPServices {
|
||||
|
||||
|
||||
|
||||
|
@ -22,6 +22,7 @@ import {
|
||||
} from "office-ui-fabric-react";
|
||||
|
||||
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
|
||||
import { ISPServices } from "../../../SPServices/ISPServices";
|
||||
|
||||
const az: string[] = [
|
||||
"A",
|
||||
@ -62,7 +63,7 @@ export default class Directory extends React.Component<
|
||||
IDirectoryProps,
|
||||
IDirectoryState
|
||||
> {
|
||||
private _services: spservices = null;
|
||||
private _services: ISPServices = null;
|
||||
|
||||
constructor(props: IDirectoryProps) {
|
||||
super(props);
|
||||
|
Loading…
x
Reference in New Issue
Block a user