Index: springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java	(revision 3b6962d804b15d4cf06da32490fdbafc33fe3ea5)
+++ springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -25,5 +25,5 @@
 @RestController
 @RequestMapping("/public")
-@CrossOrigin(origins = { "http://192.168.0.19:3000", "http://192.168.0.39:3000" })
+@CrossOrigin(origins = { "http://192.168.0.29:3000", "http://192.168.0.28:3000" })
 public class PublicController {
 
Index: springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java	(revision 3b6962d804b15d4cf06da32490fdbafc33fe3ea5)
+++ springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -6,4 +6,6 @@
 import mk.profesori.springapp.Model.UserRole;
 import mk.profesori.springapp.Service.CustomUserDetailsService;
+import mk.profesori.springapp.Service.DisallowedOperationException;
+import mk.profesori.springapp.Service.IncompatiblePostId;
 import mk.profesori.springapp.Service.MainService;
 import org.apache.tomcat.websocket.AuthenticationException;
@@ -18,5 +20,5 @@
 @RestController
 @RequestMapping("/secure")
-@CrossOrigin(origins = { "http://192.168.0.19:3000", "http://192.168.0.39:3000" })
+@CrossOrigin(origins = { "http://192.168.0.29:3000", "http://192.168.0.28:3000" })
 public class SecureController {
 
@@ -133,5 +135,5 @@
 
     @RequestMapping(value = "/updateOpinion/{postId}", method = RequestMethod.PUT)
-    public void updateOpinion(@RequestBody ObjectNode objectNode, @PathVariable Long postId,
+    public String updateOpinion(@RequestBody ObjectNode objectNode, @PathVariable Long postId,
             @CurrentSecurityContext SecurityContext context) {
         Authentication authentication = context.getAuthentication();
@@ -140,10 +142,17 @@
             String newContent = objectNode.get("newContent").asText();
             Long newTargetProfessorId = objectNode.get("newTargetProfessorId").asLong();
-            mainService.updateOpinion(newContent, newTargetProfessorId, postId);
-        }
+            Long newParentPostId = objectNode.get("newParentPostId").asLong();
+            try {
+                mainService.updateOpinion(newContent, newTargetProfessorId, newParentPostId, postId);
+            } catch (IncompatiblePostId | DisallowedOperationException e) {
+                return e.getMessage();
+            }
+        }
+
+        return null;
     }
 
     @RequestMapping(value = "/updateThread/{postId}", method = RequestMethod.PUT)
-    public void updateThread(@RequestBody ObjectNode objectNode, @PathVariable Long postId,
+    public String updateThread(@RequestBody ObjectNode objectNode, @PathVariable Long postId,
             @CurrentSecurityContext SecurityContext context) {
         Authentication authentication = context.getAuthentication();
@@ -153,12 +162,13 @@
             String newContent = objectNode.get("newContent").asText();
             Long newTargetSubjectId = objectNode.get("newTargetSubjectId").asLong();
-
-            if (objectNode.has("newParentThreadId")) {
-                Long newParentThreadId = objectNode.get("newParentThreadId").asLong();
+            Long newParentThreadId = objectNode.get("newParentThreadId").asLong();
+            try {
                 mainService.update_Thread(newTitle, newContent, newTargetSubjectId, newParentThreadId, postId);
-            } else {
-                mainService.update_Thread(newTitle, newContent, newTargetSubjectId, null, postId);
+            } catch (IncompatiblePostId | DisallowedOperationException e) {
+                return e.getMessage();
             }
         }
+
+        return null;
     }
 
@@ -223,8 +233,9 @@
     }
 
-    @RequestMapping(value = "/markReportResolved/{postReportId}/", method = RequestMethod.GET)
+    @RequestMapping(value = "/markReportResolved/{postReportId}/{action}", method = RequestMethod.GET)
     public void markReportResolved(@PathVariable Long postReportId, @PathVariable String action, @CurrentSecurityContext SecurityContext context) {
         Authentication authentication = context.getAuthentication();
-        if (authentication != null && authentication.getPrincipal() instanceof CustomUserDetails currentUser) {
+        if (authentication != null && authentication.getPrincipal() instanceof CustomUserDetails currentUser &&
+                currentUser.getUserRole().equals(UserRole.MODERATOR)) {
             mainService.markReport(postReportId, action);
         }
Index: springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java	(revision 3b6962d804b15d4cf06da32490fdbafc33fe3ea5)
+++ springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -37,5 +37,5 @@
             @Override
             public void addCorsMappings(CorsRegistry registry) {
-                registry.addMapping("/**").allowedOrigins("http://192.168.0.19:3000", "http://192.168.0.39:3000")
+                registry.addMapping("/**").allowedOrigins("http://192.168.0.29:3000", "http://192.168.0.28:3000")
                         .allowCredentials(true);
             }
Index: springapp/src/main/java/mk/profesori/springapp/Service/DisallowedOperationException.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/DisallowedOperationException.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
+++ springapp/src/main/java/mk/profesori/springapp/Service/DisallowedOperationException.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -0,0 +1,7 @@
+package mk.profesori.springapp.Service;
+
+public class DisallowedOperationException extends RuntimeException{
+    public DisallowedOperationException(String message) {
+        super(message);
+    }
+}
Index: springapp/src/main/java/mk/profesori/springapp/Service/IncompatiblePostId.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/IncompatiblePostId.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
+++ springapp/src/main/java/mk/profesori/springapp/Service/IncompatiblePostId.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -0,0 +1,7 @@
+package mk.profesori.springapp.Service;
+
+public class IncompatiblePostId extends RuntimeException{
+    public IncompatiblePostId(String message) {
+        super(message);
+    }
+}
Index: springapp/src/main/java/mk/profesori/springapp/Service/MainService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/MainService.java	(revision 3b6962d804b15d4cf06da32490fdbafc33fe3ea5)
+++ springapp/src/main/java/mk/profesori/springapp/Service/MainService.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -141,6 +141,7 @@
     public void addThread(String title, String content, Long subjectId, CustomUserDetails currentUser) {
         Subject targetSubject = subjectRepository.findBySubjectId(subjectId);
-
-        _Thread _threadToAdd = new _Thread(title, content, currentUser, null, null, null, targetSubject);
+        String titleToSet = title.equals("") ? null : title;
+
+        _Thread _threadToAdd = new _Thread(titleToSet, content, currentUser, null, null, null, targetSubject);
         _threadRepository.save(_threadToAdd);
     }
@@ -199,5 +200,5 @@
     public void delete_Thread(Long postId) {_threadRepository.deleteById(postId);}
 
-    public void updateOpinion(String newContent, Long newTargetProfessorId, Long postId) {
+    public String updateOpinion(String newContent, Long newTargetProfessorId, Long newParentPostId, Long postId) {
         Opinion opinionToUpdate = opinionRepository.findByPostId(postId);
 
@@ -205,5 +206,16 @@
 
         Professor newTargetProfessor = professorRepository.findByProfessorId(newTargetProfessorId);
-        opinionToUpdate.setTargetProfessor(newTargetProfessor); //opcijava da ja dava samo kaj postovi so parentPost==null
+        opinionToUpdate.setTargetProfessor(newTargetProfessor);
+
+        Opinion newParentOpinion = null;
+        if (newParentPostId != -1) {
+            newParentOpinion = opinionRepository.findByPostId(newParentPostId);
+            if (!newParentOpinion.getTargetProfessor().equals(newTargetProfessor))
+                throw new IncompatiblePostId("Мислењето не припаѓа во специфицираната секција за дискусија.");
+            if (opinionToUpdate.getChildren().contains(newParentOpinion))
+                throw new DisallowedOperationException("Мислењето не може да се постави како дете на негово дете (бесконечна рекурзија)");
+        }
+        opinionToUpdate.setParent(newParentOpinion);
+
         for(Post p : opinionToUpdate.getChildren()) {
             Opinion o = (Opinion) p;
@@ -212,7 +224,8 @@
         opinionToUpdate.setTimeLastEdited(LocalDateTime.now());
         opinionRepository.save(opinionToUpdate);
-    }
-
-    public void update_Thread(String newTitle, String newContent, Long newTargetSubjectId, Long newParentThreadId, Long postId) {
+        return null;
+    }
+
+    public String update_Thread(String newTitle, String newContent, Long newTargetSubjectId, Long newParentThreadId, Long postId) {
         _Thread _threadToUpdate = _threadRepository.findByPostId(postId);
 
@@ -222,19 +235,19 @@
         _threadToUpdate.setTargetSubject(newTargetSubject);
 
-        if(newParentThreadId != null) { //samo ako e specificirano
-            _Thread newParentThread = _threadRepository.findByPostId(newParentThreadId);
-
-            if (_threadToUpdate.getParent() == null || _threadToUpdate.getParent().getPostId().equals(postId)) {
-                _threadToUpdate.setParent(newParentThread);
-            }//samo ako e naslovniot post ili directChild
-            } else if(_threadToUpdate.getParent() != null) {
-            _threadToUpdate.setParent(null);
-            }
+        _Thread newParentThread = null;
+        if(newParentThreadId != -1) {
+            newParentThread = _threadRepository.findByPostId(newParentThreadId);
+            if (!newParentThread.getTargetSubject().equals(newTargetSubject))
+                throw new IncompatiblePostId("Мислењето не припаѓа во специфицираната секција за дискусија.");
+            if (_threadToUpdate.getChildren().contains(newParentThread))
+                throw new DisallowedOperationException("Мислењето не може да се постави како дете на негово дете (бесконечна рекурзија)");
+        }
+        _threadToUpdate.setParent(newParentThread);
 
             if(_threadToUpdate.getParent() == null) {
              _threadToUpdate.setTitle(newTitle);
             } else {
-             _threadToUpdate.setTitle(null);
-             }
+                _threadToUpdate.setTitle(null);
+            }
 
          for(Post p : _threadToUpdate.getChildren()) {
@@ -244,4 +257,5 @@
          _threadToUpdate.setTimeLastEdited(LocalDateTime.now());
           _threadRepository.save(_threadToUpdate);
+          return null;
     }
 
@@ -280,4 +294,5 @@
         if (action.equals("resolve")) report.setResolved(true);
         else if (action.equals("open")) report.setResolved(false);
+        postReportRepository.save(report);
      }
 
Index: springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java	(revision 3b6962d804b15d4cf06da32490fdbafc33fe3ea5)
+++ springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -45,5 +45,5 @@
                 String tokenToResend = customUserDetailsService
                         .createToken(userRepository.findByEmail(request.getEmail()).get());
-                String link = "http://192.168.0.19:8080/registration/confirm?token=" + tokenToResend;
+                String link = "http://192.168.0.29:8080/registration/confirm?token=" + tokenToResend;
                 emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link));
                 return tokenToResend;
@@ -66,5 +66,5 @@
                         UserRole.REGULAR));
 
-        String link = "http://192.168.0.19:8080/registration/confirm?token=" + token;
+        String link = "http://192.168.0.29:8080/registration/confirm?token=" + token;
 
         emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link));
Index: springapp/src/main/resources/application.properties
===================================================================
--- springapp/src/main/resources/application.properties	(revision 3b6962d804b15d4cf06da32490fdbafc33fe3ea5)
+++ springapp/src/main/resources/application.properties	(revision 4abf55a556ca76069528c751a92cddaa146d108d)
@@ -1,11 +1,10 @@
-spring.datasource.url=jdbc:postgresql://localhost:5432/profesori.mk
-spring.datasource.connectionProperties=useUnicode=true;characterEncoding=utf-8;
+spring.datasource.url=jdbc:postgresql://localhost:5432/profesorimk
 spring.datasource.username=postgres
-spring.datasource.password=1win7337
+spring.datasource.password=baz@228
 spring.jpa.hibernate.ddl-auto=update
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 spring.jpa.show-sql=false
 spring.jpa.properties.hibernate.format_sql=true
-server.address=192.168.0.19
+server.address=192.168.0.29
 spring.mail.host=localhost
 spring.mail.username=mailuser
