Skip to content

Conversation

@kkartunov
Copy link
Contributor

No description provided.

&& response.data.result.status === 200 && response.data.result.content
&& response.data.result.content.length === 1) {
return response.data.result.content[0];
if (response.data && response.status === 200 && response.data.length === 1) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from response.data.result.content to response.data assumes that the API response structure has changed. Ensure that this change is reflected across all parts of the application that consume this data, as it could lead to unexpected errors if other parts of the codebase still expect the old structure.

}).then((res) => {
logger.debug(`Role info by ${roleId}: ${JSON.stringify(res.data.result.content)}`);
return _.get(res, 'data.result.content', []);
logger.debug(`Role info by ${roleId}: ${JSON.stringify(res.data)}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from res.data.result.content to res.data assumes a different response structure. Verify that this change is consistent with the API's documentation and that all consuming code is updated accordingly to prevent runtime errors.

const roles = res.data;
logger.debug(`Roles by ${roleName}: ${JSON.stringify(roles)}`);
return roles.result.content
return roles

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from roles.result.content to roles assumes a different response structure. Ensure that this change is consistent with the API's documentation and that all consuming code is updated accordingly to prevent runtime errors.

logger.debug(`Roles for user ${userId}: ${JSON.stringify(res.data.result.content)}`);
return _.get(res, 'data.result.content', []).map(r => r.roleName);
logger.debug(`Roles for user ${userId}: ${JSON.stringify(res.data)}`);
return (res.data || []).map(r => r.roleName);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from res.data.result.content to res.data assumes a different response structure. Ensure that this change is consistent with the API's documentation and that all consuming code is updated accordingly to prevent runtime errors.

.then((response) => {
const data = _.get(response, 'data.result.content', null);
if (!data) { throw new Error('Response does not have result.content'); }
const data = _.get(response, 'data', null);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from response.data.result.content to response.data assumes a different response structure. Ensure that this change is consistent with the API's documentation and that all consuming code is updated accordingly to prevent runtime errors.

.then((responses) => {
const data = responses.reduce((contents, response) => {
const content = _.get(response, 'data.result.content', []);
const content = response.data || [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from response.data.result.content to response.data assumes a different response structure. Ensure that this change is consistent with the API's documentation and that all consuming code is updated accordingly to prevent runtime errors.

@jmgasper jmgasper merged commit 61861d5 into master Nov 19, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants