Adds includeDeleted flag to get remote cluster app and store methods (#28182)

Этот коммит содержится в:
Miguel de la Cruz
2024-09-13 23:08:53 +02:00
коммит произвёл GitHub
родитель 46ca7747f8
Коммит cae456de2d
19 изменённых файлов: 78 добавлений и 57 удалений

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

@@ -117,7 +117,7 @@ func (a *App) AddRemoteCluster(rc *model.RemoteCluster) (*model.RemoteCluster, *
}
func (a *App) PatchRemoteCluster(rcId string, patch *model.RemoteClusterPatch) (*model.RemoteCluster, *model.AppError) {
rc, err := a.GetRemoteCluster(rcId)
rc, err := a.GetRemoteCluster(rcId, false)
if err != nil {
return nil, err
}
@@ -152,8 +152,8 @@ func (a *App) DeleteRemoteCluster(remoteClusterId string) (bool, *model.AppError
return deleted, nil
}
func (a *App) GetRemoteCluster(remoteClusterId string) (*model.RemoteCluster, *model.AppError) {
rc, err := a.Srv().Store().RemoteCluster().Get(remoteClusterId)
func (a *App) GetRemoteCluster(remoteClusterId string, includeDeleted bool) (*model.RemoteCluster, *model.AppError) {
rc, err := a.Srv().Store().RemoteCluster().Get(remoteClusterId, includeDeleted)
if err != nil {
switch {
case errors.Is(err, sql.ErrNoRows):