[MM-44168] Add feature to restore archived user groups (#20369)

* Add undelete feature, add mocks, tests

* Rename undelete->restore

* make store-layers

* make app-layers

* Store -> Store()

* Lint fixes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Shivashis Padhi
2022-11-17 14:53:54 +05:30
коммит произвёл GitHub
родитель 17332035fa
Коммит 5be8557247
14 изменённых файлов: 301 добавлений и 0 удалений

Просмотреть файл

@@ -4101,6 +4101,22 @@ func (s *TimerLayerGroupStore) PermittedSyncableAdmins(syncableID string, syncab
return result, err
}
func (s *TimerLayerGroupStore) Restore(groupID string) (*model.Group, error) {
start := time.Now()
result, err := s.GroupStore.Restore(groupID)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.Restore", success, elapsed)
}
return result, err
}
func (s *TimerLayerGroupStore) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, error) {
start := time.Now()