From 560531a56ca182d676fe2dfa561da149940cda1b Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Fri, 27 Jan 2023 13:20:42 -0500 Subject: [PATCH] Updates to /connector/sharepoint/data_collections.go CollectPages() method updated to create BetaService and to store service within collection. --- src/internal/connector/sharepoint/data_collections.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/internal/connector/sharepoint/data_collections.go b/src/internal/connector/sharepoint/data_collections.go index bd3b856b6..7c449f799 100644 --- a/src/internal/connector/sharepoint/data_collections.go +++ b/src/internal/connector/sharepoint/data_collections.go @@ -7,6 +7,7 @@ import ( "github.com/pkg/errors" "github.com/alcionai/corso/src/internal/connector/graph" + "github.com/alcionai/corso/src/internal/connector/graph/betasdk" "github.com/alcionai/corso/src/internal/connector/onedrive" "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/internal/data" @@ -176,9 +177,14 @@ func collectPages( spcs := make([]data.Collection, 0) // make the betaClient - betaService := betaService + adpt, err := graph.CreateAdapter(creds.AzureTenantID, creds.AzureClientID, creds.AzureClientSecret) + if err != nil { + return nil, errors.Wrap(err, "adapter for betaservice not created") + } - tuples, err := fetchPages(ctx, serv, siteID) + betaService := betasdk.NewService(adpt) + + tuples, err := fetchPages(ctx, betaService, siteID) if err != nil { return nil, err } @@ -195,6 +201,7 @@ func collectPages( } collection := NewCollection(dir, serv, updater.UpdateStatus) + collection.betaService = betaService collection.AddJob(tuple.id) spcs = append(spcs, collection)