mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
@@ -403,11 +403,11 @@ func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error) {
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node {
|
||||
n, err := nuo.Save(ctx)
|
||||
node, err := nuo.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return n
|
||||
return node
|
||||
}
|
||||
|
||||
// Exec executes the query on the entity.
|
||||
@@ -423,7 +423,7 @@ func (nuo *NodeUpdateOne) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) {
|
||||
func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) {
|
||||
_spec := &sqlgraph.UpdateSpec{
|
||||
Node: &sqlgraph.NodeSpec{
|
||||
Table: node.Table,
|
||||
@@ -529,9 +529,9 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
n = &Node{config: nuo.config}
|
||||
_spec.Assign = n.assignValues
|
||||
_spec.ScanValues = n.scanValues()
|
||||
_node = &Node{config: nuo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues()
|
||||
if err = sqlgraph.UpdateNode(ctx, nuo.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{node.Label}
|
||||
@@ -540,5 +540,5 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) {
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return n, nil
|
||||
return _node, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user