aboutsummaryrefslogtreecommitdiff
path: root/Backend/Api/Api/Controllers/UserController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Backend/Api/Api/Controllers/UserController.cs')
-rw-r--r--Backend/Api/Api/Controllers/UserController.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Backend/Api/Api/Controllers/UserController.cs b/Backend/Api/Api/Controllers/UserController.cs
index 94e4b41..1bc395f 100644
--- a/Backend/Api/Api/Controllers/UserController.cs
+++ b/Backend/Api/Api/Controllers/UserController.cs
@@ -64,5 +64,15 @@ namespace Api.Controllers
return Ok(rez);
return BadRequest();
}
+ [HttpGet("history")]
+ [Authorize(Roles = "User")]
+ public async Task<ActionResult<List<PostSend>>> ViewHistory()
+ {
+ var id = await _userService.UserIdFromJwt();
+ var rez = await _postService.UserHistory(id);
+ if (rez != null)
+ return Ok(rez);
+ return BadRequest();
+ }
}
}