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…