feat: create root dir on acc registration

This commit is contained in:
2025-11-30 17:37:59 +00:00
parent 0b8aee5d60
commit fb8e91dd47
2 changed files with 7 additions and 0 deletions

View File

@@ -59,6 +59,11 @@ func (s *Service) Register(ctx context.Context, db bun.IDB, opts RegisterOptions
return nil, nil, err return nil, nil, err
} }
_, err = s.vfs.CreateDirectory(ctx, db, acc.ID, uuid.Nil, virtualfs.RootDirectoryName)
if err != nil {
return nil, nil, err
}
return acc, u, nil return acc, u, nil
} }

View File

@@ -41,6 +41,8 @@ type FileContent struct {
blobKey blob.Key blobKey blob.Key
} }
const RootDirectoryName = "root"
func FileContentFromReader(reader io.Reader) FileContent { func FileContentFromReader(reader io.Reader) FileContent {
return FileContent{reader: reader} return FileContent{reader: reader}
} }