[Infra]: Removed duplicate call to .find method on the errors object

This commit is contained in:
Jesulayomy
2025-08-02 04:13:29 -04:00
parent 2fc0eb9460
commit aa35e9211b
@@ -102,9 +102,8 @@ const CreateInfrastructureMonitor = () => {
};
const getAlertError = (errors) => {
return Object.keys(errors).find((key) => key.startsWith(METRIC_PREFIX))
? errors[Object.keys(errors).find((key) => key.startsWith(METRIC_PREFIX))]
: null;
const errorKey = Object.keys(errors).find((key) => key.startsWith(METRIC_PREFIX));
return errorKey ? errors[errorKey] : null;
};
// Populate form fields if editing