Commit a9281eaf authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: Clear sheet info when updating existing Preview

parent 11c588d2
......@@ -85,8 +85,10 @@ public class MetadataServiceImpl implements MetadataService {
Preview preview = previewService.getPreview(referenceUuid);
if (preview == null) {
preview = new Preview();
} else {
LOG.warn("Preview with UUID={} already exists. Content will be updated.", referenceUuid);
preview.getSheets().clear(); // remove existing sheets
}
LOG.warn("Preview with UUID={} already exists. Content will be updated.", referenceUuid);
preview.setName(csvFile.getOriginalFilename());
preview.setReferenceUuid(referenceUuid);
......@@ -173,6 +175,9 @@ public class MetadataServiceImpl implements MetadataService {
Preview preview = previewService.getPreview(referenceUuid);
if (preview == null) {
preview = new Preview();
} else {
LOG.warn("Preview with UUID={} already exists. Content will be updated.", referenceUuid);
preview.getSheets().clear(); // remove existing sheets
}
preview.setName(excelFile.getOriginalFilename());
preview.setReferenceUuid(referenceUuid);
......
  • @mborodenko @vpavlov Sheets were appended with every update of the file. This fix is now in main amphibian branch (for the Dataset validation).

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment