Skip to content

Commit

Permalink
Dont send Enable=false in UpdateService
Browse files Browse the repository at this point in the history
  • Loading branch information
dkovacevic committed Dec 7, 2023
1 parent a344e10 commit c8ca23b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public Response enableService(NewCookie zprovider, UUID serviceId, String passwo
WebTarget connection = servicesTarget
.path(serviceId.toString())
.path("connection");
Logger.debug("enableService: PUT %s", connection.getUri());
return connection
.request(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -208,7 +207,7 @@ static class _UpdateService {
public String name;

@JsonProperty
public boolean enabled;
public Boolean enabled;

@JsonProperty("public_keys")
public String[] pubKeys;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ public Response create(@ApiParam(hidden = true) @CookieParam(Z_ROMAN) String tok
NewCookie cookie;

try (Response login = providerClient.login(provider.email, provider.password)) {

Logger.debug("ServiceResource.create: login status: %d", login.getStatus());

if (login.getStatus() >= 400) {
String msg = login.readEntity(String.class);
Logger.debug("ServiceResource.create: login response: %s", msg);
Logger.warning("ServiceResource.create: login response: %s", msg);
return Response.
ok(msg).
status(login.getStatus()).
Expand All @@ -111,7 +110,7 @@ public Response create(@ApiParam(hidden = true) @CookieParam(Z_ROMAN) String tok

if (create.getStatus() >= 400) {
String msg = create.readEntity(String.class);
Logger.debug("ServiceResource.create: create service response: %s", msg);
Logger.warning("ServiceResource.create: create service response: %s", msg);
return Response.
ok(msg).
status(create.getStatus()).
Expand All @@ -122,17 +121,16 @@ public Response create(@ApiParam(hidden = true) @CookieParam(Z_ROMAN) String tok
}

try (Response update = providerClient.enableService(cookie, service.id, provider.password)) {

Logger.debug("ServiceResource.create: enable service status: %d", update.getStatus());

// if (update.getStatus() >= 400) {
// String msg = update.readEntity(String.class);
// Logger.debug("ServiceResource.create: enable service (%s) response: %s", service.id, msg);
// return Response.
// ok(msg).
// status(update.getStatus()).
// build();
// }
if (update.getStatus() >= 400) {
String msg = update.readEntity(String.class);
Logger.warning("ServiceResource.create: enable service (%s) response: %s", service.id, msg);
return Response.
ok(msg).
status(update.getStatus()).
build();
}

providersDAO.update(providerId, payload.url, service.auth, service.id, payload.name, payload.commandPrefix);

Expand Down

0 comments on commit c8ca23b

Please sign in to comment.