diff --git a/samples/react-office-add-in-save-email-to-sharepoint/src/webparts/saveEmailToSharePoint/components/Services/Services.ts b/samples/react-office-add-in-save-email-to-sharepoint/src/webparts/saveEmailToSharePoint/components/Services/Services.ts deleted file mode 100644 index b0c866595..000000000 --- a/samples/react-office-add-in-save-email-to-sharepoint/src/webparts/saveEmailToSharePoint/components/Services/Services.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { sp } from '../SPPreset'; -import { Web } from '@pnp/sp/webs'; -import { SearchResults } from '@pnp/sp/search'; -import { WebPartContext } from '@microsoft/sp-webpart-base'; -import { MSGraphClient } from "@microsoft/sp-http"; - -export default class Services { - public async getSiteNames(): Promise { - const allSiteResults: SearchResults = await sp.search({ - Querytext: "contentclass:STS_Site contentclass:STS_Web", - EnableInterleaving: true, - RowLimit: 100 - }); - return allSiteResults; - } - public getRootSiteURL(): Promise { - return sp.web.get().then((data) => { - return data.ResourcePath.DecodedUrl; - }); - } - public saveFileToSP(SiteURL: string, serverRelativeURL: string, filename: string, file): Promise { - let web = Web(SiteURL); - return web.getFolderByServerRelativeUrl(serverRelativeURL).files.add(filename, file, true).then((result) => { - return result; - }); - } - public getEmailContent(context: WebPartContext, id: string): Promise { - return context.msGraphClientFactory.getClient().then((client: MSGraphClient): Promise< void> => { - return client.api('/me/messages/' + id + '/$value').version('v1.0').responseType('blob').get().then((response: any) => { - return response; - }); - }); - } - public getAllDocumentLibary(absoluteURL: string): Promise { - return sp.site.getDocumentLibraries(absoluteURL).then((libraries: any[]) => { - return libraries; - }); - - } -} \ No newline at end of file