feat: update jobs
This commit is contained in:
@@ -164,11 +164,19 @@ func (m *usersModel) Update(ctx context.Context, id int64, userModel *model.User
|
||||
userModel.UpdatedAt = time.Now()
|
||||
|
||||
tbl := table.Users
|
||||
stmt := tbl.UPDATE(tbl.MutableColumns.Except(tbl.CreatedAt, tbl.DeletedAt)).MODEL(userModel).WHERE(tbl.ID.EQ(Int64(id))).RETURNING(tbl.AllColumns)
|
||||
stmt := tbl.
|
||||
UPDATE(
|
||||
tbl.MutableColumns.Except(
|
||||
tbl.CreatedAt,
|
||||
tbl.DeletedAt,
|
||||
),
|
||||
).
|
||||
MODEL(userModel).
|
||||
WHERE(tbl.ID.EQ(Int64(id))).
|
||||
RETURNING(tbl.AllColumns)
|
||||
m.log.Infof("sql: %s", stmt.DebugSql())
|
||||
|
||||
var updatedUser model.Users
|
||||
|
||||
if err := stmt.QueryContext(ctx, db, &updatedUser); err != nil {
|
||||
m.log.Errorf("error updating user: %v", err)
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user