mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 04:40:05 -06:00
constify the "trashed" space state
This commit is contained in:
@@ -40,6 +40,7 @@ import (
|
||||
const (
|
||||
_spaceTypePersonal = "personal"
|
||||
_spaceTypeProject = "project"
|
||||
_spaceStateTrashed = "trashed"
|
||||
|
||||
_sortDescending = "desc"
|
||||
)
|
||||
@@ -535,7 +536,7 @@ func (g Graph) formatDrives(ctx context.Context, baseURL *url.URL, storageSpaces
|
||||
}
|
||||
|
||||
// can't access disabled space
|
||||
if utils.ReadPlainFromOpaque(storageSpace.Opaque, "trashed") != "trashed" {
|
||||
if utils.ReadPlainFromOpaque(storageSpace.Opaque, "trashed") != _spaceStateTrashed {
|
||||
res.Special = g.getSpecialDriveItems(ctx, baseURL, storageSpace)
|
||||
quota, err := g.getDriveQuota(ctx, storageSpace)
|
||||
res.Quota = "a
|
||||
|
||||
@@ -28,6 +28,10 @@ import (
|
||||
|
||||
//go:generate mockery --name=Searcher
|
||||
|
||||
const (
|
||||
_spaceStateTrashed = "trashed"
|
||||
)
|
||||
|
||||
// Searcher is the interface to the SearchService
|
||||
type Searcher interface {
|
||||
Search(ctx context.Context, req *searchsvc.SearchRequest) (*searchsvc.SearchResponse, error)
|
||||
@@ -85,7 +89,7 @@ func (s *Service) Search(ctx context.Context, req *searchsvc.SearchRequest) (*se
|
||||
|
||||
spaces := []*provider.StorageSpace{}
|
||||
for _, space := range listSpacesRes.StorageSpaces {
|
||||
if utils.ReadPlainFromOpaque(space.Opaque, "trashed") == "trashed" {
|
||||
if utils.ReadPlainFromOpaque(space.Opaque, "trashed") == _spaceStateTrashed {
|
||||
// Do not consider disabled spaces
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user