-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EDGEPATRON-131]-Added POST edge api for LOC patron #113
Conversation
import java.util.List; | ||
import java.util.Map; | ||
import java.util.TimeZone; | ||
import java.util.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove wild card imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
import org.folio.edge.patron.model.Account; | ||
import org.folio.edge.patron.model.Charge; | ||
import org.folio.edge.patron.model.Hold; | ||
import org.folio.edge.patron.model.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove wildcards import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -151,6 +153,21 @@ public void handlePlaceItemHold(RoutingContext ctx) { | |||
t -> handleProxyException(ctx, t))); | |||
} | |||
|
|||
public void handlePatronRequest(RoutingContext ctx) { | |||
if (ctx.body().asJsonObject() == null) { | |||
badRequest(ctx, MSG_HOLD_NOBODY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the error message specific to this api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
logger.debug("response: " + respBody); | ||
} | ||
|
||
String contentType = resp.getHeader(HttpHeaders.CONTENT_TYPE.toString()); | ||
|
||
if (resp.statusCode() < 400){ | ||
if (resp.statusCode() < 400 && Objects.nonNull(respBody)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the use of new condition here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vignesh-kalyanasundaram :- just as precaution , There might be a case when we receive an empty or null response from mod-patron. in this case this code will not fail as NullPointer exception .
Quality Gate passedIssues Measures |
https://folio-org.atlassian.net/browse/EDGPATRON-131
Approcah:- Added edge api call for POST endpoint (/patron/account)