generated from alecodes/base-template
feat: allow to fetch nodes
This commit is contained in:
parent
3cf643c83d
commit
8af94161ab
8 changed files with 141 additions and 30 deletions
|
|
@ -186,9 +186,11 @@ func (conn *DB) NewPlatform(name string, metadata []byte) (*Platform, error) {
|
|||
return err
|
||||
}
|
||||
|
||||
collection.is_default = true
|
||||
|
||||
platform = &Platform{
|
||||
Node: *node,
|
||||
collections: []*Collection{collection},
|
||||
Collections: []*Collection{collection},
|
||||
}
|
||||
|
||||
_, err = conn.addRelationwithTx(tx, platform.Id, &collection_relation{}, collection.Id)
|
||||
|
|
@ -232,8 +234,9 @@ func (conn *DB) newCollectionwithTx(tx *sql.Tx, name string, metadata []byte) (*
|
|||
}
|
||||
|
||||
collection := &Collection{
|
||||
Node: *node,
|
||||
childs: make([]*Node, 0),
|
||||
Node: *node,
|
||||
childs: make([]*Node, 0),
|
||||
is_default: false,
|
||||
}
|
||||
|
||||
return collection, err
|
||||
|
|
|
|||
Reference in a new issue