Adjust ChangePassword response wording

This commit is contained in:
Leon
2025-12-09 16:21:57 +08:00
parent e3ae8185be
commit 09e6398c6e

View File

@@ -92,10 +92,10 @@ func (h *AccountHandler) ChangePassword(c *gin.Context) {
return
}
if err := h.accountService.ChangePassword(c.Request.Context(), req.Username, req.OldPassword, req.NewPassword); err != nil {
c.JSON(500, gin.H{"error": err.Error()})
c.JSON(400, gin.H{"error": "unsuccessfully password changed"})
return
}
c.JSON(200, gin.H{"message": "password changed"})
c.JSON(200, gin.H{"message": "successfully password changed"})
}
func (h *AccountHandler) FindByID(c *gin.Context) {