Skip to content
Snippets Groups Projects
Commit 5bcefcdc authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

update articles works (bug detected in frontend)

parent 6c4e6585
No related branches found
No related tags found
No related merge requests found
......@@ -104,8 +104,14 @@ public class ArticlesApi {
@RequestMapping(value = "/{slug}", produces = {"application/json"}, method = RequestMethod.PUT)
public ResponseEntity<Void> updateAnArticle(
@ApiParam(value = "slug", required = true) @PathVariable("slug") String slug,
@ApiParam(value = "Article to update", required = true) Article article) throws NotFoundException {
// do some magic!
@RequestBody @ApiParam(value = "Article to update", required = true) Article article, Principal principal) throws NotFoundException {
User user = MIPApplication.getUser(principal);
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
session.update(article);
session.getTransaction().commit();
return new ResponseEntity<Void>(HttpStatus.OK);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment