Update to /connector/sharepoint/data_collections.go

Finalize the backup workflow for SharePoint.Pages.
This commit is contained in:
Danny Adams 2023-01-21 00:40:33 -05:00
parent 3c7c156e72
commit 0f16e5768f

View File

@ -10,7 +10,6 @@ import (
"github.com/alcionai/corso/src/internal/connector/support"
"github.com/alcionai/corso/src/internal/data"
"github.com/alcionai/corso/src/internal/observe"
"github.com/alcionai/corso/src/pkg/account"
"github.com/alcionai/corso/src/pkg/control"
"github.com/alcionai/corso/src/pkg/logger"
"github.com/alcionai/corso/src/pkg/path"
@ -76,6 +75,18 @@ func DataCollections(
if err != nil {
return nil, support.WrapAndAppend(site, err, errs)
}
case path.PagesCategory:
spcs, err = collectPages(
ctx,
serv,
tenantID,
site,
scope,
su,
ctrlOpts)
if err != nil {
return nil, support.WrapAndAppend(site, err, errs)
}
}
collections = append(collections, spcs...)
@ -156,10 +167,10 @@ func collectLibraries(
}
// collectPages constructs a sharepoint Collections struct and Get()s the associated
// M365 IDs for the associated Pages
// M365 IDs for the associated Pages.
// TODO: Credentials necessary to create separate HTTP client
func collectPages(
ctx context.Context,
creds account.M365Config,
serv graph.Servicer,
tenantID, siteID string,
scope selectors.SharePointScope,