ready to PR
This commit is contained in:
		@ -27,6 +27,7 @@ dependencies {
 | 
			
		||||
	implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0")
 | 
			
		||||
	// implementation("org.springframework.session:spring-session-jdbc")
 | 
			
		||||
	developmentOnly("org.springframework.boot:spring-boot-devtools")
 | 
			
		||||
	developmentOnly("org.springframework.boot:spring-boot-docker-compose")
 | 
			
		||||
	runtimeOnly("org.postgresql:postgresql")
 | 
			
		||||
	testImplementation("org.springframework.boot:spring-boot-starter-test")
 | 
			
		||||
	testImplementation("org.springframework.boot:spring-boot-testcontainers")
 | 
			
		||||
 | 
			
		||||
@ -88,7 +88,6 @@ public class CourseController {
 | 
			
		||||
    {
 | 
			
		||||
        if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
 | 
			
		||||
            return new UnauthorizedResponse<>(null);
 | 
			
		||||
        System.out.println(course.getOwner().getRegNo());
 | 
			
		||||
        Course createdCourse = courseServ.save(course);
 | 
			
		||||
        if (createdCourse == null)
 | 
			
		||||
            return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);
 | 
			
		||||
 | 
			
		||||
@ -103,7 +103,7 @@ public class LessonService {
 | 
			
		||||
                case "lessonType":
 | 
			
		||||
                    target.setLessonType((String) entry.getValue());
 | 
			
		||||
                    break;
 | 
			
		||||
                case "courseId":
 | 
			
		||||
                case "courseID":
 | 
			
		||||
                    target.setCourse(courseRepo.findById((int) entry.getValue()));
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -50,7 +50,7 @@ public class ProtectionService {
 | 
			
		||||
 | 
			
		||||
        HashMap<String ,Object> toReturn = new HashMap<>();
 | 
			
		||||
 | 
			
		||||
        toReturn.put("courseID",course.getCourseId());
 | 
			
		||||
        toReturn.put("courseID",course.getCourseID());
 | 
			
		||||
        toReturn.put("credits",course.getCredits());
 | 
			
		||||
        toReturn.put("title", course.getTitle());
 | 
			
		||||
        toReturn.put("owner", userWithoutPassword(course.getOwner()));
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,7 @@ import org.hibernate.annotations.OnDeleteAction;
 | 
			
		||||
public class Course {
 | 
			
		||||
    @Id
 | 
			
		||||
    @GeneratedValue(strategy = GenerationType.AUTO)
 | 
			
		||||
    private int courseId;
 | 
			
		||||
    private int courseID;
 | 
			
		||||
    private int credits;
 | 
			
		||||
    private String title;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user