chore: rename account to storage
This commit is contained in:
@ -14,16 +14,16 @@ func get(ctx context.Context, path string) (model.Obj, error) {
|
||||
path = utils.StandardizePath(path)
|
||||
// maybe a virtual file
|
||||
if path != "/" {
|
||||
virtualFiles := operations.GetAccountVirtualFilesByPath(stdpath.Dir(path))
|
||||
virtualFiles := operations.GetStorageVirtualFilesByPath(stdpath.Dir(path))
|
||||
for _, f := range virtualFiles {
|
||||
if f.GetName() == stdpath.Base(path) {
|
||||
return f, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
account, actualPath, err := operations.GetAccountAndActualPath(path)
|
||||
storage, actualPath, err := operations.GetStorageAndActualPath(path)
|
||||
if err != nil {
|
||||
// if there are no account prefix with path, maybe root folder
|
||||
// if there are no storage prefix with path, maybe root folder
|
||||
if path == "/" {
|
||||
return model.Object{
|
||||
Name: "root",
|
||||
@ -32,7 +32,7 @@ func get(ctx context.Context, path string) (model.Obj, error) {
|
||||
IsFolder: true,
|
||||
}, nil
|
||||
}
|
||||
return nil, errors.WithMessage(err, "failed get account")
|
||||
return nil, errors.WithMessage(err, "failed get storage")
|
||||
}
|
||||
return operations.Get(ctx, account, actualPath)
|
||||
return operations.Get(ctx, storage, actualPath)
|
||||
}
|
||||
|
Reference in New Issue
Block a user