fix(abdm): safely decode raw body in recordsFetch if getJSON fails
This commit is contained in:
parent
092e5cd193
commit
677472e6b0
|
|
@ -4858,7 +4858,12 @@ class AbdmGateway extends BaseController
|
|||
]);
|
||||
}
|
||||
|
||||
$body = $this->request->getJSON(true) ?: [];
|
||||
try {
|
||||
$body = $this->request->getJSON(true) ?: [];
|
||||
} catch (\Throwable) {
|
||||
$rawBody = (string) $this->request->getBody();
|
||||
$body = json_decode($rawBody, true) ?: [];
|
||||
}
|
||||
$careContextRefs = $body['careContextReferences'] ?? [];
|
||||
if (empty($careContextRefs) && !empty($body['careContextReference'])) {
|
||||
$careContextRefs = [$body['careContextReference']];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user