fix: integrate correct AddCategories (#4926)
fixes duplication of AddCategories function. calls the correct AddCategories function #### Does this PR need a docs update or release note? - [x] ⛔ No #### Type of change - [x] 🐛 Bugfix #### Issue(s) #4754 #### Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [x] ⚡ Unit test - [x] 💚 E2E
This commit is contained in:
parent
a1590e0d2f
commit
926489d004
@ -226,30 +226,11 @@ func sharePointBackupCreateSelectors(
|
|||||||
|
|
||||||
sel := selectors.NewSharePointBackup(append(slices.Clone(sites), weburls...))
|
sel := selectors.NewSharePointBackup(append(slices.Clone(sites), weburls...))
|
||||||
|
|
||||||
return addCategories(sel, cats), nil
|
return utils.AddCategories(sel, cats), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func includeAllSitesWithCategories(ins idname.Cacher, categories []string) *selectors.SharePointBackup {
|
func includeAllSitesWithCategories(ins idname.Cacher, categories []string) *selectors.SharePointBackup {
|
||||||
return addCategories(selectors.NewSharePointBackup(ins.IDs()), categories)
|
return utils.AddCategories(selectors.NewSharePointBackup(ins.IDs()), categories)
|
||||||
}
|
|
||||||
|
|
||||||
func addCategories(sel *selectors.SharePointBackup, cats []string) *selectors.SharePointBackup {
|
|
||||||
// Issue #2631: Libraries are the only supported feature for SharePoint at this time.
|
|
||||||
if len(cats) == 0 {
|
|
||||||
sel.Include(sel.LibraryFolders(selectors.Any()))
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, d := range cats {
|
|
||||||
switch d {
|
|
||||||
// [TODO] uncomment when lists are enabled
|
|
||||||
// case flags.DataLists:
|
|
||||||
// sel.Include(sel.Lists(selectors.Any()))
|
|
||||||
case flags.DataLibraries:
|
|
||||||
sel.Include(sel.LibraryFolders(selectors.Any()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -69,7 +69,7 @@ func MakeSharePointOpts(cmd *cobra.Command) SharePointOpts {
|
|||||||
func SharePointAllowedCategories() map[string]struct{} {
|
func SharePointAllowedCategories() map[string]struct{} {
|
||||||
return map[string]struct{}{
|
return map[string]struct{}{
|
||||||
flags.DataLibraries: {},
|
flags.DataLibraries: {},
|
||||||
// flags.DataLists: {},
|
// flags.DataLists: {}, [TODO]: uncomment when lists are enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user