diff --git a/OliverBooth/Controllers/AdminController.cs b/OliverBooth/Controllers/AdminController.cs index 5fb65dd..8775435 100644 --- a/OliverBooth/Controllers/AdminController.cs +++ b/OliverBooth/Controllers/AdminController.cs @@ -68,7 +68,9 @@ public sealed class AdminController : ControllerBase public IActionResult Logout() { if (_sessionService.TryGetSession(Request, out ISession? session)) + { _sessionService.DeleteSession(session); + } return _sessionService.DeleteSessionCookie(Response); } diff --git a/OliverBooth/Controllers/Blog/BlogApiController.cs b/OliverBooth/Controllers/Blog/BlogApiController.cs index c5ab926..96de884 100644 --- a/OliverBooth/Controllers/Blog/BlogApiController.cs +++ b/OliverBooth/Controllers/Blog/BlogApiController.cs @@ -56,7 +56,10 @@ public sealed class BlogApiController : ControllerBase [HttpGet("author/{id:guid}")] public IActionResult GetAuthor(Guid id) { - if (!_userService.TryGetUser(id, out IUser? author)) return NotFound(); + if (!_userService.TryGetUser(id, out IUser? author)) + { + return NotFound(); + } return Ok(new { @@ -69,7 +72,11 @@ public sealed class BlogApiController : ControllerBase [HttpGet("post/{id:guid?}")] public IActionResult GetPost(Guid id) { - if (!_blogPostService.TryGetPost(id, out IBlogPost? post)) return NotFound(); + if (!_blogPostService.TryGetPost(id, out IBlogPost? post)) + { + return NotFound(); + } + return Ok(CreatePostObject(post, true)); }