From 9c5f1c3424fc9e2fa30897626e15586a8fdba6a1 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Fri, 9 Dec 2022 21:34:56 +0100 Subject: Popravljena promena lozinke. --- Backend/Api/Api/Controllers/UserController.cs | 4 ++-- Backend/Api/Api/Models/User.cs | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'Backend/Api') 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> ChangePass(string currentPass, string newPass) + public async Task> 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 followers{ get; set; } + public List followers { get; set; } public List 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 { 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; } + } } -- cgit v1.2.3