Commit 3f90f6fe authored by Milan Mozolák's avatar Milan Mozolák
Browse files

Simplified resource creation

parent 577df7b8
Pipeline #142201 waiting for manual action with stage
......@@ -7,6 +7,7 @@ import cz.fi.muni.pa165.seminar4.group7.facade.MissionFacade;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
* @author Milan Mozolak
......@@ -48,9 +49,9 @@ public class MissionFacadeImpl implements MissionFacade {
}
private List<Resource> createResources(List<Resource> resources) {
for (int i = 0; i < resources.size(); i++) {
if (resources.get(i).getId() == null) {
resources.set(i, new Resource(resources.get(i).getName()));
for (var resource : resources) {
if (resource.getId() == null) {
resource.setId(UUID.randomUUID().toString());
}
}
return resources;
......
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