forked from Yara724/api
log the my policies
This commit is contained in:
@@ -3863,8 +3863,30 @@ export class ClaimRequestManagementService {
|
||||
}),
|
||||
);
|
||||
|
||||
const policyCount = Array.isArray(response.data)
|
||||
? response.data.length
|
||||
: 0;
|
||||
const lastPolicy = policyCount > 0 ? response.data[policyCount - 1] : null;
|
||||
|
||||
this.logger.log(
|
||||
`${logPrefix} Policy inquiry response status=${response.status} count=${policyCount}`,
|
||||
);
|
||||
this.logger.log(
|
||||
`${logPrefix} Policy inquiry raw response: ${JSON.stringify(
|
||||
response.data,
|
||||
null,
|
||||
2,
|
||||
)}`,
|
||||
);
|
||||
if (lastPolicy && typeof lastPolicy === "object") {
|
||||
this.logger.log(
|
||||
`${logPrefix} Policy inquiry last policy keys: ${Object.keys(
|
||||
lastPolicy,
|
||||
).join(", ")}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (Array.isArray(response.data) && response.data.length > 0) {
|
||||
const lastPolicy = response.data[response.data.length - 1];
|
||||
const policyId = lastPolicy?.PolicyId;
|
||||
if (policyId !== undefined && policyId !== null) {
|
||||
this.logger.log(
|
||||
|
||||
Reference in New Issue
Block a user