mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Change tree creation logic
This commit is contained in:
parent
86ba8e33d0
commit
9d9867a632
5 changed files with 36 additions and 91 deletions
|
@ -27,22 +27,13 @@ type textDocument struct {
|
|||
func CreateTextDocument(
|
||||
ctx context.Context,
|
||||
space commonspace.Space,
|
||||
account account.Service,
|
||||
listener updatelistener.UpdateListener) (doc TextDocument, err error) {
|
||||
account account.Service) (id string, err error) {
|
||||
payload := tree.ObjectTreeCreatePayload{
|
||||
SignKey: account.Account().SignKey,
|
||||
SpaceId: space.Id(),
|
||||
Identity: account.Account().Identity,
|
||||
}
|
||||
t, err := space.CreateTree(ctx, payload, listener)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return &textDocument{
|
||||
ObjectTree: t,
|
||||
account: account,
|
||||
}, nil
|
||||
return space.CreateTree(ctx, payload)
|
||||
}
|
||||
|
||||
func NewTextDocument(ctx context.Context, space commonspace.Space, id string, listener updatelistener.UpdateListener, account account.Service) (doc TextDocument, err error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue