Skip to content
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

Additional icons for new statuses & Change Password Requirement for IEC Security #375

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

Comment on lines 132 to 147
const handleError = (error, action) => {
try {
if (error instanceof Error) {
const errorMessage = error.message;

const parsedError = JSON.parse(errorMessage);
const firstErrorMessage = parsedError.errors[0]?.description;
setErrorMessage(firstErrorMessage);
} else {
console.log(`${action}: Received non-Error object:`, error);
}
} catch (e) {
console.log(`${action}: Failed to parse error response.`, e);
}
};

Copy link
Contributor

Choose a reason for hiding this comment

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

why create a function inside a function? it seems better to split the functionality

Comment on lines 130 to 141
if (isNew) {
commitAddedRows({ rowIds });
onSave(editedRow, isNew);
} else {
onSave(editedRow);
if (errorMessage !== '') {
onSave(editedRow);
stopEditRows({ rowIds });
commitChangedRows({ rowIds });
} else {
onSave(editedRow);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

you dont need to call onSave three times. just put onSave in the last line.

@sude-dewi sude-dewi requested a review from Finz-Azmi August 19, 2024 09:48
@sude-dewi sude-dewi merged commit 341ff7e into master Aug 19, 2024
1 check failed
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.

2 participants