Implementation of post deletion.

This commit is contained in:
Florian
2018-05-18 22:42:08 +02:00
parent 15be129540
commit 9fcbf4f576
2 changed files with 26 additions and 0 deletions
@@ -17,6 +17,7 @@ import org.codiki.core.repositories.PostRepository;
import org.codiki.core.security.TokenService;
import org.codiki.core.services.ParserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@@ -131,4 +132,10 @@ public class PostController {
final HttpServletResponse pResponse) throws IOException {
postService.update(pPost, pRequest, pResponse);
}
@DeleteMapping("/{postKey}")
public void delete(@PathVariable("postKey") final String pPostKey,
final HttpServletRequest pRequest, final HttpServletResponse pResponse) throws IOException {
postService.delete(pPostKey, pRequest, pResponse);
}
}