Skip to content

Commit cfbb879

Browse files
committed
SEBSP-219 fix and added TODOs
1 parent 18f1e96 commit cfbb879

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/ch/ethz/seb/sps/server/datalayer/dao/impl/SessionDAOBatis.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ private void deleteSessionScreenshots(final SessionRecord sessionRecord) {
554554
.build()
555555
.execute();
556556

557+
557558
// then all screenshots
558559
this.screenshotDAO
559560
.deleteAllForSession(sessionRecord.getUuid(), screenShotPKs)
@@ -734,17 +735,15 @@ public Result<Boolean> hasAnySessionData(Collection<Long> groupIds) {
734735
.build()
735736
.execute();
736737

737-
if (sessionIds == null || sessionIds.isEmpty()) {
738-
return false;
739-
}
740-
741-
Long dataNum = this.screenshotDataRecordMapper
742-
.countByExample()
743-
.where(ScreenshotDataRecordDynamicSqlSupport.id, isIn(sessionIds))
744-
.build()
745-
.execute();
738+
return sessionIds != null && !sessionIds.isEmpty();
746739

747-
return dataNum != null && dataNum.intValue() != 0;
740+
// Long dataNum = this.screenshotDataRecordMapper
741+
// .countByExample()
742+
// .where(ScreenshotDataRecordDynamicSqlSupport.id, isIn(sessionIds))
743+
// .build()
744+
// .execute();
745+
//
746+
// return dataNum != null && dataNum.intValue() != 0;
748747
});
749748
}
750749

src/main/java/ch/ethz/seb/sps/server/weblayer/AdminExamController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public Exam create(
101101
produces = MediaType.APPLICATION_JSON_VALUE)
102102

103103
public Collection<EntityKey> requestDelete(@PathVariable final String modelId) {
104+
// TODO this should never block here do this in background with balk action
104105
if (!this.sessionService.hasAnySessionDataForExam(modelId)) {
105106
return super.hardDelete(modelId);
106107
} else {

src/main/java/ch/ethz/seb/sps/server/weblayer/AdminGroupController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public Group create(
125125
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
126126
produces = MediaType.APPLICATION_JSON_VALUE)
127127
public Collection<EntityKey> requestDelete(@PathVariable(name = API.PARAM_MODEL_ID) final String groupUUID) {
128-
128+
// TODO this should never block here do this in background with balk action
129129
if (!this.sessionService.hasAnySessionDataForGroup(groupUUID)) {
130130
return super.hardDelete(groupUUID);
131131
} else {

0 commit comments

Comments
 (0)