return newly created category id

This commit is contained in:
Athou
2013-08-09 09:36:06 +02:00
parent 474995c8dd
commit c980e5dd67

View File

@@ -239,7 +239,7 @@ public class CategoryREST extends AbstractREST {
@Path("/add") @Path("/add")
@POST @POST
@ApiOperation(value = "Add a category", notes = "Add a new feed category") @ApiOperation(value = "Add a category", notes = "Add a new feed category", responseClass = "java.lang.Long")
public Response addCategory(@ApiParam(required = true) AddCategoryRequest req) { public Response addCategory(@ApiParam(required = true) AddCategoryRequest req) {
Preconditions.checkNotNull(req); Preconditions.checkNotNull(req);
Preconditions.checkNotNull(req.getName()); Preconditions.checkNotNull(req.getName());
@@ -256,7 +256,7 @@ public class CategoryREST extends AbstractREST {
} }
feedCategoryDAO.saveOrUpdate(cat); feedCategoryDAO.saveOrUpdate(cat);
cache.invalidateUserRootCategory(getUser()); cache.invalidateUserRootCategory(getUser());
return Response.ok().build(); return Response.ok(cat.getId()).build();
} }
@POST @POST