aboutsummaryrefslogtreecommitdiff
path: root/Backend/Api
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-12-09 21:34:56 +0100
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-12-09 21:34:56 +0100
commit9c5f1c3424fc9e2fa30897626e15586a8fdba6a1 (patch)
tree1a072a547d44bdab30d7840ac6de1c0de165ca26 /Backend/Api
parentdf1a35cf86998b412aef39d36380204cdd616540 (diff)
Popravljena promena lozinke.
Diffstat (limited to 'Backend/Api')
-rw-r--r--Backend/Api/Api/Controllers/UserController.cs4
-rw-r--r--Backend/Api/Api/Models/User.cs9
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; }
+ }
}