style: amend 278c807fa3
This commit is contained in:
parent
3917dda658
commit
6db3aba1c2
@ -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);
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user