Added Service Interface
This commit is contained in:
parent
e370e40f8b
commit
36133a9c2b
|
@ -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 { sp, PeoplePickerEntity, ClientPeoplePickerQueryParameters, SearchQuery, SearchResults, SearchProperty, SortDirection } from '@pnp/sp';
|
||||||
import { PrincipalType } from "@pnp/sp/src/sitegroups";
|
import { PrincipalType } from "@pnp/sp/src/sitegroups";
|
||||||
import { isRelativeUrl } from "office-ui-fabric-react";
|
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";
|
} from "office-ui-fabric-react";
|
||||||
|
|
||||||
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
|
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
|
||||||
|
import { ISPServices } from "../../../SPServices/ISPServices";
|
||||||
|
|
||||||
const az: string[] = [
|
const az: string[] = [
|
||||||
"A",
|
"A",
|
||||||
|
@ -62,7 +63,7 @@ export default class Directory extends React.Component<
|
||||||
IDirectoryProps,
|
IDirectoryProps,
|
||||||
IDirectoryState
|
IDirectoryState
|
||||||
> {
|
> {
|
||||||
private _services: spservices = null;
|
private _services: ISPServices = null;
|
||||||
|
|
||||||
constructor(props: IDirectoryProps) {
|
constructor(props: IDirectoryProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
Loading…
Reference in New Issue