feat: update models
This commit is contained in:
@@ -51,5 +51,9 @@ type UserBalance struct {
|
||||
// @Bind id path
|
||||
// @Bind balance body
|
||||
func (ctl *users) Balance(ctx fiber.Ctx, id int64, balance *UserBalance) error {
|
||||
return model.UsersModel.AddBalance(ctx.Context(), id, balance.Balance)
|
||||
user, err := model.UsersModel.GetByID(ctx.Context(), id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return user.SetBalance(ctx.Context(), balance.Balance)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user