[Infra]: Removed duplicate call to .find method on the errors object
This commit is contained in:
1 parent
2fc0eb9460
commit
aa35e9211b
1 file changed
+2
-3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user