Fix configuration empty case

This commit is contained in:
Krzysztof Bialoglowicz 2019-08-29 13:23:23 +02:00
parent 6e4c19154d
commit be5be600c7
2 changed files with 12 additions and 10 deletions

View file

@ -64,11 +64,12 @@ const PluginsDetailsPage: React.StatelessComponent<PluginsDetailsPageProps> = ({
name === "active"
? (newData.active = value)
: (newData.active = data.active);
newData.configuration.map(item => {
if (item.name === name) {
item.value = value;
}
});
newData.configuration &&
newData.configuration.map(item => {
if (item.name === name) {
item.value = value;
}
});
triggerChange();
set(newData);

View file

@ -63,12 +63,13 @@ export const PluginsDetails: React.StatelessComponent<PluginsDetailsProps> = ({
onBack={() => navigate(pluginsListUrl())}
onSubmit={formData => {
const configurationInput = [];
formData.configuration.map(item => {
configurationInput.push({
name: item.name,
value: item.value.toString()
formData.configuration &&
formData.configuration.map(item => {
configurationInput.push({
name: item.name,
value: item.value.toString()
});
});
});
pluginUpdate({
variables: {
id,