Fix return values from Ignore and Unignore endpoints

In the successful case the endpoints should return OK, but were
returning null. This resulted in exceptions when calling from the UI.

Change-Id: I570a251403dc1ca31e6147a9f1da31b0c160b06f
This commit is contained in:
David Pursehouse
2017-04-28 12:39:03 +02:00
parent e714cef782
commit 7081268cd8
2 changed files with 4 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ public class Ignore
}
@Override
public Object apply(ChangeResource rsrc, Input input) throws RestApiException {
public Response<String> apply(ChangeResource rsrc, Input input) throws RestApiException {
try {
if (rsrc.isUserOwner() || isIgnored(rsrc)) {
// early exit for own changes and already ignored changes
@@ -62,7 +62,7 @@ public class Ignore
} catch (OrmException e) {
throw new RestApiException("failed to ignore change", e);
}
return null;
return Response.ok("");
}
private boolean isIgnored(ChangeResource rsrc) {

View File

@@ -52,7 +52,7 @@ public class Unignore
}
@Override
public Object apply(ChangeResource rsrc, Input input) throws RestApiException {
public Response<String> apply(ChangeResource rsrc, Input input) throws RestApiException {
try {
if (rsrc.isUserOwner() || !isIgnored(rsrc)) {
// early exit for own changes and not ignored changes
@@ -62,7 +62,7 @@ public class Unignore
} catch (OrmException e) {
throw new RestApiException("failed to unignore change", e);
}
return null;
return Response.ok("");
}
private boolean isIgnored(ChangeResource rsrc) {