a fix in editCache

This commit is contained in:
Michael 2019-05-13 15:41:13 +02:00
parent c1dcba7c04
commit 30cb1d1579

View File

@ -171,8 +171,10 @@ public class CacheConstructionUtil {
for (Cache cache1 : cacheRepository.findAll()) { for (Cache cache1 : cacheRepository.findAll()) {
if (cache1.getName().equals(cache.getName())) { if (cache1.getName().equals(cache.getName())) {
deleteNewCreatedStationsUtil(newCreatedStationList); if (cache1 != oldCache) {
return ResponseEntity.status(400).body("name is already taken"); deleteNewCreatedStationsUtil(newCreatedStationList);
return ResponseEntity.status(400).body("name is already taken");
}
} }
} }