diff options
Diffstat (limited to 'Backend')
-rw-r--r-- | Backend/Api/Api/Controllers/UserController.cs | 4 | ||||
-rw-r--r-- | Backend/Api/Api/Models/User.cs | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Backend/Api/Api/Controllers/UserController.cs b/Backend/Api/Api/Controllers/UserController.cs index 30beac4..abdf685 100644 --- a/Backend/Api/Api/Controllers/UserController.cs +++ b/Backend/Api/Api/Controllers/UserController.cs @@ -164,9 +164,9 @@ namespace Api.Controllers [HttpPost("changePass")] [Authorize(Roles = "User")] - public async Task<ActionResult<int>> ChangePass(string currentPass, string newPass) + public async Task<ActionResult<int>> ChangePass([FromBody] ChangePass cp) { - return Ok(await _userService.ChangePass(currentPass,newPass)); + return Ok(await _userService.ChangePass(cp.currentPass,cp.newPass)); } diff --git a/Backend/Api/Api/Models/User.cs b/Backend/Api/Api/Models/User.cs index 620c9c8..f789ffe 100644 --- a/Backend/Api/Api/Models/User.cs +++ b/Backend/Api/Api/Models/User.cs @@ -65,7 +65,7 @@ namespace Api.Models public File? pfp { get; set; } public int postcount { get; set; } - public List<String> followers{ get; set; } + public List<String> followers { get; set; } public List<String> following { get; set; } public int followersCount { get; set; } @@ -80,7 +80,7 @@ namespace Api.Models public int totalViews { get; set; } public int numberOfPosts { get; set; } public int numberOfRatingsOnPosts { get; set; } - public double averagePostRatingOnPosts {get; set; } + public double averagePostRatingOnPosts { get; set; } public List<MonthlyViews> monthlyViews { get; set; } public int numberOfFavouritePosts { get; set; } } @@ -90,4 +90,9 @@ namespace Api.Models public int month { get; set; } public int views { get; set; } } + public class ChangePass + { + public string currentPass { get; set; } + public string newPass { get; set; } + } } |