Delete a post
This commit is contained in:
parent
d2080679fd
commit
0d29e9494a
2 changed files with 15 additions and 2 deletions
|
@ -100,7 +100,10 @@ namespace Robware.Api.Blog.Controllers {
|
|||
[HttpGet(nameof(GetAllPosts))]
|
||||
public async Task<ActionResult<BlogPost[]>> GetAllPosts() => (await _blogRepository.GetAllPostsAsync()).ToArray();
|
||||
|
||||
//[HttpGet]
|
||||
//Task DeletePost(int id);
|
||||
[HttpPost(nameof(DeletePost))]
|
||||
public async Task<ActionResult> DeletePost([FromBody] int id) {
|
||||
await _blogRepository.DeletePostAsync(id);
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue