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