From 713915d0a328f8fa3c4c2da223494ad4f12a4652 Mon Sep 17 00:00:00 2001 From: Harsha Vardhini Date: Mon, 18 May 2020 13:38:29 +0530 Subject: [PATCH] Delete Services.ts --- .../components/Services/Services.ts | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 samples/react-office-add-in-save-email-to-sharepoint/src/webparts/saveEmailToSharePoint/components/Services/Services.ts 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