refactored db code
This commit is contained in:
@@ -40,12 +40,11 @@ func CreateUser(ctx context.Context, tx bun.Tx, username string, discorduser *di
|
||||
DiscordID: discorduser.ID,
|
||||
}
|
||||
|
||||
_, err := tx.NewInsert().
|
||||
Model(user).
|
||||
err := Insert(tx, user).
|
||||
Returning("id").
|
||||
Exec(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "tx.NewInsert")
|
||||
return nil, errors.Wrap(err, "db.Insert")
|
||||
}
|
||||
|
||||
return user, nil
|
||||
|
||||
Reference in New Issue
Block a user