From dd36390a083fdb0a7d0a532ebd7478bb89b984f1 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Wed, 25 Nov 2020 09:13:27 -0500 Subject: [PATCH] =?UTF-8?q?La=20mise=20=C3=A0=20jour=20d'un=20type=20de=20?= =?UTF-8?q?produit=20ignorait=20s'il=20=C3=A9tait=20un=20type=20syst=C3=A8?= =?UTF-8?q?me.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colorrecipesexplorer/service/MaterialTypeService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt index 563f338..1fa50a0 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt @@ -56,7 +56,8 @@ class MaterialTypeServiceImpl(repository: MaterialTypeRepository, private val ma MaterialType( id = id, name = if (name.isNotBlank()) name else persistedMaterialType.name, - prefix = if (prefix.isNotBlank()) prefix else persistedMaterialType.prefix + prefix = if (prefix.isNotBlank()) prefix else persistedMaterialType.prefix, + systemType = systemType ) }) } @@ -75,7 +76,7 @@ class MaterialTypeServiceImpl(repository: MaterialTypeRepository, private val ma fun saveOrUpdateSystemType(type: MaterialType) { if (existsByName(type.name)) { val persistedMaterialType = getByName(type.name) - update(materialType(type, newId = persistedMaterialType.id)) + update(materialType(type, newId = persistedMaterialType.id, newSystemType = true)) } else { save(type) }