itheakhilesh3301 commented on PR #6061:
URL: https://github.com/apache/fineract/pull/6061#issuecomment-4845527033
@adamsaghy
Thanks for checking
Yes, you are absolutely correct that officeId must be provided as an
incoming parameter for the reports to function properly.
The main issue this PR attempts to solve is how the backend behaves when a
client API request fails to provide that required officeId (or other required
parameters). Previously, omitting a parameter would cause the API to crash with
a 500 Internal Server Error because the ${officeId} SQL placeholder was left
unresolved, breaking the query syntax.
In this PR, I added logic so that if the officeId is missing, it gracefully
falls back to the current user's office ID instead of crashing. Additionally,
if other required parameters are missing, it now properly throws a
PlatformApiDataValidationException (returning a clean 400 Bad Request) rather
than a 500 error.
Since officeId is strictly required, would you prefer that I remove the
"fallback" logic for officeId, and simply have the API return a strict 400 Bad
Request whenever any required report parameter is missing? I am happy to update
the PR to whichever behavior the Fineract team prefers for missing parameters!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]