mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
add array check before iterating
This commit is contained in:
parent
d0316392f6
commit
314f73448a
@ -20,9 +20,12 @@ const prepare = (methods, dispatch) => {
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
input.strategies.forEach((s) => {
|
||||
delete s.id;
|
||||
});
|
||||
if (Array.isArray(input.strategies)) {
|
||||
input.strategies.forEach((s) => {
|
||||
delete s.id;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createFeatureToggles(input)(dispatch)
|
||||
.then(() => methods.clear())
|
||||
|
@ -30,9 +30,11 @@ const prepare = (methods, dispatch) => {
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
input.strategies.forEach((s) => {
|
||||
delete s.id;
|
||||
});
|
||||
if (Array.isArray(input.strategies)) {
|
||||
input.strategies.forEach((s) => {
|
||||
delete s.id;
|
||||
});
|
||||
}
|
||||
// TODO: should add error handling
|
||||
requestUpdateFeatureToggle(input)(dispatch)
|
||||
.then(() => methods.clear())
|
||||
|
Loading…
Reference in New Issue
Block a user