diff --git a/src/internal/m365/collection/site/restore_test.go b/src/internal/m365/collection/site/restore_test.go index e70c0d3e6..6323b9858 100644 --- a/src/internal/m365/collection/site/restore_test.go +++ b/src/internal/m365/collection/site/restore_test.go @@ -109,7 +109,7 @@ func (suite *SharePointRestoreSuite) TestListCollection_Restore_invalidListTempl suite.ac, suite.siteID, suite.creds, - api.DocumentLibraryListTemplateName) + api.DocumentLibraryListTemplate) return lrh, destName, mockData }, @@ -123,7 +123,7 @@ func (suite *SharePointRestoreSuite) TestListCollection_Restore_invalidListTempl suite.ac, suite.siteID, suite.creds, - api.WebTemplateExtensionsListTemplateName) + api.WebTemplateExtensionsListTemplate) return lrh, destName, mockData }, diff --git a/src/pkg/services/m365/api/lists.go b/src/pkg/services/m365/api/lists.go index 901e91639..c27f08bbc 100644 --- a/src/pkg/services/m365/api/lists.go +++ b/src/pkg/services/m365/api/lists.go @@ -48,11 +48,12 @@ const ( ReadOnlyOrHiddenFieldNamePrefix = "_" DescoratorFieldNamePrefix = "@" - WebTemplateExtensionsListTemplateName = "webTemplateExtensionsList" + WebTemplateExtensionsListTemplate = "webTemplateExtensionsList" // This issue https://github.com/alcionai/corso/issues/4932 // tracks to backup/restore supportability of `documentLibrary` templated lists - DocumentLibraryListTemplateName = "documentLibrary" - SharingLinksListTemplateName = "sharingLinks" + DocumentLibraryListTemplate = "documentLibrary" + SharingLinksListTemplate = "sharingLinks" + AccessRequestsListTemplate = "accessRequest" ) var addressFieldNames = []string{ @@ -88,9 +89,10 @@ var readOnlyFieldNames = keys.Set{ } var SkipListTemplates = keys.Set{ - WebTemplateExtensionsListTemplateName: {}, - DocumentLibraryListTemplateName: {}, - SharingLinksListTemplateName: {}, + WebTemplateExtensionsListTemplate: {}, + DocumentLibraryListTemplate: {}, + SharingLinksListTemplate: {}, + AccessRequestsListTemplate: {}, } // --------------------------------------------------------------------------- diff --git a/src/pkg/services/m365/api/lists_test.go b/src/pkg/services/m365/api/lists_test.go index 22d62615d..c9f70690e 100644 --- a/src/pkg/services/m365/api/lists_test.go +++ b/src/pkg/services/m365/api/lists_test.go @@ -778,17 +778,22 @@ func (suite *ListsAPIIntgSuite) TestLists_PostList_invalidTemplate() { }{ { name: "list with template documentLibrary", - template: DocumentLibraryListTemplateName, + template: DocumentLibraryListTemplate, expect: assert.Error, }, { name: "list with template webTemplateExtensionsList", - template: WebTemplateExtensionsListTemplateName, + template: WebTemplateExtensionsListTemplate, expect: assert.Error, }, { name: "list with template sharingLinks", - template: SharingLinksListTemplateName, + template: SharingLinksListTemplate, + expect: assert.Error, + }, + { + name: "list with template accessRequest", + template: AccessRequestsListTemplate, expect: assert.Error, }, } @@ -881,7 +886,7 @@ func getStoredListBytes(t *testing.T, template string) []byte { defer writer.Close() overrideListInfo := models.NewListInfo() - overrideListInfo.SetTemplate(ptr.To(WebTemplateExtensionsListTemplateName)) + overrideListInfo.SetTemplate(ptr.To(template)) _, list := getFieldsDataAndList() list.SetList(overrideListInfo)