feat(admin): stabilize blog and admin patterns
TaxBaik CI/CD / build-and-deploy (push) Has been cancelled
TaxBaik CI/CD / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -32,6 +32,16 @@ public class BlogController : ControllerBase
|
||||
return Ok(post);
|
||||
}
|
||||
|
||||
[HttpGet("admin/{id:int}")]
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetById(int id)
|
||||
{
|
||||
var post = await _blogService.GetByIdAsync(id);
|
||||
if (post == null)
|
||||
return NotFound(new ProblemDetails { Title = "포스트를 찾을 수 없습니다.", Status = StatusCodes.Status404NotFound });
|
||||
return Ok(post);
|
||||
}
|
||||
|
||||
[HttpGet("admin/all")]
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetAll()
|
||||
@@ -84,7 +94,7 @@ public class BlogController : ControllerBase
|
||||
[Authorize]
|
||||
public async Task<IActionResult> Delete(int id)
|
||||
{
|
||||
await _blogService.DeleteAsync(id);
|
||||
await _blogService.ArchiveAsync(id);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user