Skip to content

Commit

Permalink
Fix couple bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbirk committed Oct 17, 2024
1 parent b2b9c56 commit de7bf65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.PageRequest;
Expand Down Expand Up @@ -474,6 +475,7 @@ ResponseEntity<Model> createModel(
}
}

@Data
public static class CreateModelFromOldRequest {

Model oldModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public void retainMetadataFields(final Model other) {
metadata.retainMetadataFields(other.getMetadata());
}

if (getDescription() == null) {
setDescription(other.getDescription());
}

final List<String> propertiesToPreserve = List.of(
"states",
"metadata",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public class ModelMetadata extends SupportAdditionalProperties implements Serial
private byte[] description;

public void retainMetadataFields(final ModelMetadata other) {
if (description == null) {
description = other.description;
}
if (gollmCard == null) {
gollmCard = other.gollmCard;
}
Expand Down

0 comments on commit de7bf65

Please sign in to comment.