feat: support set user phone
This commit is contained in:
@@ -193,6 +193,15 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
},
|
||||
Body[UserBalance]("balance"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /admin/v1/users/:id/phone -> users.SetPhone")
|
||||
router.Post("/admin/v1/users/:id/phone"[len(r.Path()):], Func2(
|
||||
r.users.SetPhone,
|
||||
func(ctx fiber.Ctx) (*models.User, error) {
|
||||
v := fiber.Params[int](ctx, "id")
|
||||
return models.UserQuery.WithContext(ctx).Where(field.NewUnsafeFieldRaw("id = ?", v)).First()
|
||||
},
|
||||
Body[UserPhoneForm]("form"),
|
||||
))
|
||||
|
||||
r.log.Info("Successfully registered all routes")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user