Nike-Inc / cerberus

The Cerberus micro-service, a secure property store for cloud applications. It includes a REST API, authentication and encryption features, as well as a self-service web UI for users.

Home Page:http://nike-inc.github.io/cerberus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delete category always return HttpResponseStatus.NO_CONTENT.code()

blling opened this issue · comments

Delete category always return HttpResponseStatus.NO_CONTENT.code() status and with Void response, then how should user knows delete category success or not?

public ResponseInfo<Void> deleteCategory(final String id) {
  final boolean isDeleted = categoryService.deleteCategory(id);

  if (isDeleted) {
      return ResponseInfo.<Void>newBuilder().withHttpStatusCode(HttpResponseStatus.NO_CONTENT.code()).build();
    }

  return ResponseInfo.<Void>newBuilder().withHttpStatusCode(HttpResponseStatus.NOT_FOUND.code()).build();
}

@vicbevis
If its deleted a 204 (HttpResponseStatus.NO_CONTENT.code()) is returned.
If the category didn't exist to delete a 404 (HttpResponseStatus.NOT_FOUND.code()) is returned.
if there is an exception some where in delete then a 500 would be returned.

Is there something here that I am missing?

sorry.it my missunderstand…