[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) => {
|
const getAlertError = (errors) => {
|
||||||
return Object.keys(errors).find((key) => key.startsWith(METRIC_PREFIX))
|
const errorKey = Object.keys(errors).find((key) => key.startsWith(METRIC_PREFIX));
|
||||||
? errors[Object.keys(errors).find((key) => key.startsWith(METRIC_PREFIX))]
|
return errorKey ? errors[errorKey] : null;
|
||||||
: null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Populate form fields if editing
|
// Populate form fields if editing
|
||||||
|
|||||||
Reference in new issue
Block a user