forked from mirrors/homebox
parent
feab9f4c46
commit
a042496c71
96 changed files with 1650 additions and 491 deletions
|
@ -487,7 +487,7 @@ func (ic *ItemCreate) Mutation() *ItemMutation {
|
|||
// Save creates the Item in the database.
|
||||
func (ic *ItemCreate) Save(ctx context.Context) (*Item, error) {
|
||||
ic.defaults()
|
||||
return withHooks[*Item, ItemMutation](ctx, ic.sqlSave, ic.mutation, ic.hooks)
|
||||
return withHooks(ctx, ic.sqlSave, ic.mutation, ic.hooks)
|
||||
}
|
||||
|
||||
// SaveX calls Save and panics if Save returns an error.
|
||||
|
@ -921,8 +921,8 @@ func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error) {
|
|||
return nil, err
|
||||
}
|
||||
builder.mutation = mutation
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
var err error
|
||||
nodes[i], specs[i] = builder.createSpec()
|
||||
if i < len(mutators)-1 {
|
||||
_, err = mutators[i+1].Mutate(root, icb.builders[i+1].mutation)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue