File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
server/src/main/java/de/tum/cit/aet/thesis Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -258,14 +258,14 @@ public ResponseEntity<ThesisDto> updateThesisInfo(
258258
259259 thesis = thesisService .updateThesisInfo (
260260 thesis ,
261- RequestValidator .validateStringMaxLength (payload .abstractText (), StringLimits .UNLIMITED_TEXT .getLimit ()),
262- RequestValidator .validateStringMaxLength (payload .infoText (), StringLimits .UNLIMITED_TEXT .getLimit ())
261+ RequestValidator .validateStringMaxLengthAllowNull (payload .abstractText (), StringLimits .UNLIMITED_TEXT .getLimit ()),
262+ RequestValidator .validateStringMaxLengthAllowNull (payload .infoText (), StringLimits .UNLIMITED_TEXT .getLimit ())
263263 );
264264
265265 thesis = thesisService .updateThesisTitles (
266266 thesis ,
267- RequestValidator .validateStringMaxLength (payload .primaryTitle (), StringLimits .THESIS_TITLE .getLimit ()),
268- RequestValidator . validateNotNull ( payload .secondaryTitles () )
267+ RequestValidator .validateStringMaxLengthAllowNull (payload .primaryTitle (), StringLimits .THESIS_TITLE .getLimit ()),
268+ payload .secondaryTitles ()
269269 );
270270
271271 return ResponseEntity .ok (ThesisDto .fromThesisEntity (thesis , thesis .hasAdvisorAccess (currentUser ), thesis .hasStudentAccess (currentUser )));
Original file line number Diff line number Diff line change @@ -322,8 +322,8 @@ public Thesis updateThesisInfo(
322322 String infoText
323323 ) {
324324 currentUserProvider ().assertCanAccessResearchGroup (thesis .getResearchGroup ());
325- thesis .setAbstractField (abstractText );
326- thesis .setInfo (infoText );
325+ thesis .setAbstractField (abstractText != null ? abstractText : "" );
326+ thesis .setInfo (infoText != null ? infoText : "" );
327327
328328 thesis = thesisRepository .save (thesis );
329329
@@ -339,11 +339,15 @@ public Thesis updateThesisTitles(
339339 Map <String , String > titles
340340 ) {
341341 currentUserProvider ().assertCanAccessResearchGroup (thesis .getResearchGroup ());
342- thesis .setMetadata (new ThesisMetadata (
343- titles ,
344- thesis .getMetadata ().credits ()
345- ));
346- thesis .setTitle (primaryTitle );
342+ if (titles != null ) {
343+ thesis .setMetadata (new ThesisMetadata (
344+ titles ,
345+ thesis .getMetadata ().credits ()
346+ ));
347+ }
348+ if (primaryTitle != null ) {
349+ thesis .setTitle (primaryTitle );
350+ }
347351
348352 thesis = thesisRepository .save (thesis );
349353
You can’t perform that action at this time.
0 commit comments