From 1645f40520f00056664f99ada1706f3991c6ac03 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Tue, 11 Apr 2017 11:43:04 +0200
Subject: [PATCH] getting project data retrieves information from cache

---
 .../java/lcsb/mapviewer/api/project/ProjectRestImpl.java   | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/project/ProjectRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/project/ProjectRestImpl.java
index 4b7ec9b6ac..5ccd2454c2 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/project/ProjectRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/project/ProjectRestImpl.java
@@ -88,12 +88,9 @@ public class ProjectRestImpl {
 		return result;
 	}
 
-	private ProjectMetaData createData(Project project) {
+	private ProjectMetaData createData(Project project, AuthenticationToken token) {
 		ProjectMetaData result = new ProjectMetaData();
-		ModelData model = null;
-		if (project.getModels().size() > 0) {
-			model = project.getModels().iterator().next();
-		}
+		ModelData model = modelService.getLastModelByProjectId(project.getProjectId(), token).getModelData();
 
 		result.setName(project.getName());
 		result.setProjectId(project.getProjectId());
-- 
GitLab