fiix body parser change to form value
This commit is contained in:
parent
3080b94640
commit
cc3c3b07b2
|
@ -28,9 +28,10 @@ type changePasswordReq struct {
|
|||
}
|
||||
|
||||
func (handler ProsodyHandler) Post(c *fiber.Ctx) error {
|
||||
req := changePasswordReq{}
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return RenderError(c, fmt.Errorf("id is empty"), defaultErrMessage)
|
||||
req := changePasswordReq{
|
||||
CurrentPassword: c.FormValue("current_password", ""),
|
||||
NewPassword: c.FormValue("new_password", ""),
|
||||
User: c.FormValue("user", ""),
|
||||
}
|
||||
log.Println("req.User, req.CurrentPassword, req.NewPassword", req.User, req.CurrentPassword, req.NewPassword)
|
||||
if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil {
|
||||
|
|
Loading…
Reference in New Issue