Commit 4c7bcc25 authored by Spiros Koulouzis's avatar Spiros Koulouzis

fixed upload bug for API v0.0

parent ad1a19cb
......@@ -27,7 +27,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.dao.CloudCredentialsDao;
import nl.uva.sne.drip.api.exception.NullKeyException;
import nl.uva.sne.drip.api.exception.NullKeyIDException;
import nl.uva.sne.drip.api.service.CloudCredentialsService;
......
......@@ -110,13 +110,14 @@ public class ProvisionController0 {
List<nl.uva.sne.drip.commons.v0.types.File> plans = upload.file;
nl.uva.sne.drip.commons.v1.types.Plan topLevelPlan = null;
Set<String> loweLevelPlansIDs = new HashSet<>();
for (nl.uva.sne.drip.commons.v0.types.File p : plans) {
nl.uva.sne.drip.commons.v1.types.Plan plan1 = Converter.File2Plan1(p);
if (plan1.getLevel() == 0) {
topLevelPlan = plan1;
} else {
plan1 = planService.save(plan1);
loweLevelPlansIDs.add(plan1.getId());
planService.save(plan1);
}
}
topLevelPlan.setLoweLevelPlansIDs(loweLevelPlansIDs);
......
Markdown is supported
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