From 2163abddf70ed09f0c84f5c4ad5869d632508e70 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Tue, 10 Mar 2020 12:54:56 -0400 Subject: [PATCH] =?UTF-8?q?Correction:=20Il=20=C3=A9tait=20impossible=20de?= =?UTF-8?q?=20cr=C3=A9er=20des=20produits,=20erreur=20lors=20de=20la=20cr?= =?UTF-8?q?=C3=A9ation=20du=20SIMDUT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/services/model/MaterialService.java | 6 ++++-- src/main/resources/templates/recipe/edit.html | 2 +- src/main/resources/updates.md | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/core/services/model/MaterialService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/core/services/model/MaterialService.java index c9fb245..927f855 100644 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/core/services/model/MaterialService.java +++ b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/core/services/model/MaterialService.java @@ -99,9 +99,11 @@ public class MaterialService extends AbstractService { } public Material save(@NotNull Material material, MultipartFile file) { - simdutService.write(material, file); + Material saved = save(material); - return save(material); + if (!file.isEmpty()) simdutService.write(saved, file); + + return saved; } @Override diff --git a/src/main/resources/templates/recipe/edit.html b/src/main/resources/templates/recipe/edit.html index e4d07fc..9e72587 100644 --- a/src/main/resources/templates/recipe/edit.html +++ b/src/main/resources/templates/recipe/edit.html @@ -160,7 +160,7 @@

-
+