Skip to content

Commit

Permalink
hotfix: 프로젝트 아이디 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Aug 23, 2024
1 parent d6f41f3 commit 47ac7a9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.example.whopper.interfaces.resume.dto.ProjectElementDto;
import com.example.whopper.domain.file.ImageInfo;
import lombok.Getter;
import org.bson.types.ObjectId;

import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -47,11 +48,14 @@ public static ProjectElement fromRequest(ProjectElementDto request) {
}

public record Section(
String elementId,
String title,
String description
) {
public static Section of(String title, String description) {
return new Section(title, description);
public Section {
if (elementId.isBlank()) {
elementId = new ObjectId().toHexString();
}
}
}
}

0 comments on commit 47ac7a9

Please sign in to comment.