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 {
|
func (handler ProsodyHandler) Post(c *fiber.Ctx) error {
|
||||||
req := changePasswordReq{}
|
req := changePasswordReq{
|
||||||
if err := c.BodyParser(&req); err != nil {
|
CurrentPassword: c.FormValue("current_password", ""),
|
||||||
return RenderError(c, fmt.Errorf("id is empty"), defaultErrMessage)
|
NewPassword: c.FormValue("new_password", ""),
|
||||||
|
User: c.FormValue("user", ""),
|
||||||
}
|
}
|
||||||
log.Println("req.User, req.CurrentPassword, req.NewPassword", req.User, req.CurrentPassword, req.NewPassword)
|
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 {
|
if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue