From 172837d6d1cb5e9b1eb95217bd2312d923234256 Mon Sep 17 00:00:00 2001 From: Wawilski Date: Sun, 21 Apr 2024 18:46:54 +0200 Subject: [PATCH] ready to PR --- backend/build.gradle.kts | 1 + .../java/ovh/herisson/Clyde/EndPoints/CourseController.java | 1 - .../java/ovh/herisson/Clyde/Services/LessonService.java | 2 +- .../java/ovh/herisson/Clyde/Services/ProtectionService.java | 2 +- backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java | 2 +- frontend/src/Apps/ManageCourses.vue | 4 ++-- frontend/src/Apps/ManageOwnLessons.vue | 2 +- frontend/src/Apps/ManageSchedule.vue | 6 +++--- frontend/src/Apps/Schedule.vue | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 810f47e..794631f 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -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") diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java index 5d73444..f85980c 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/CourseController.java @@ -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); diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java index 7bda70e..292a6a6 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/LessonService.java @@ -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; } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java index 710bf70..ae3593b 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ProtectionService.java @@ -50,7 +50,7 @@ public class ProtectionService { HashMap 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())); diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java index 96b8064..369a8bc 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java @@ -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; diff --git a/frontend/src/Apps/ManageCourses.vue b/frontend/src/Apps/ManageCourses.vue index 6645dee..445a1f4 100644 --- a/frontend/src/Apps/ManageCourses.vue +++ b/frontend/src/Apps/ManageCourses.vue @@ -64,13 +64,13 @@ async function patchCourse(course){ for (let element in toModify){ if (element =="owner" && (toModify[element].regNo != course.owner.regNo)){ - await alterCourse(course.courseId,{owner:toModify[element].regNo}); + await alterCourse(course.courseID,{owner:toModify[element].regNo}); } else if(element == "title" && (toModify[element] != course.title)){ await alterCourse(course.courseId,{title:toModify[element]}); } else if(element == "credits" && (parseInt(toModify[element]) != course.credits)){ - await alterCourse(course.courseId,{credits:parseInt(toModify[element])}); + await alterCourse(course.courseID,{credits:parseInt(toModify[element])}); } } toModify= Object.assign({},pattern); diff --git a/frontend/src/Apps/ManageOwnLessons.vue b/frontend/src/Apps/ManageOwnLessons.vue index 56d7d18..ba762ef 100644 --- a/frontend/src/Apps/ManageOwnLessons.vue +++ b/frontend/src/Apps/ManageOwnLessons.vue @@ -142,7 +142,7 @@ async function askChanges(i){
{{i18n("course")}}:
diff --git a/frontend/src/Apps/ManageSchedule.vue b/frontend/src/Apps/ManageSchedule.vue index 0dd6d81..b34e4a5 100644 --- a/frontend/src/Apps/ManageSchedule.vue +++ b/frontend/src/Apps/ManageSchedule.vue @@ -55,7 +55,7 @@ const minDate = ref(invertedFormatDate((new Date()).setDate(currentDate.getDate( } const lessonCreator = { - "courseId" : null, + "courseID" : null, "lessonStart":null, "lessonEnd":null, "lessonType":null, @@ -157,7 +157,7 @@ async function setCourses(){ } const matrix = []; for (let element in lessons){ - if(lessons[element].course.courseId == course.courseId){ + if(lessons[element].course.courseID == course.courseID){ matrix.push(lessons[element]) } } @@ -210,7 +210,7 @@ async function setCourses(){ lessonCreatorBuffer.value.color = lessonBuffer.value.color; lessonCreatorBuffer.value.lessonType =lessonBuffer.value.lessonType; lessonCreatorBuffer.value.local = lessonBuffer.value.local; - lessonCreatorBuffer.value.courseId = lessonBuffer.value.course.courseId; + lessonCreatorBuffer.value.courseID = lessonBuffer.value.course.courseID; await createLesson(lessonCreatorBuffer.value); diff --git a/frontend/src/Apps/Schedule.vue b/frontend/src/Apps/Schedule.vue index d4f097c..1ee30fd 100644 --- a/frontend/src/Apps/Schedule.vue +++ b/frontend/src/Apps/Schedule.vue @@ -196,7 +196,7 @@ focus.value = element; var lessonsList = []; for (let element in schedule.value){ - if (schedule.value[element].course.courseId == focus.value.course.courseId){ + if (schedule.value[element].course.courseID == focus.value.course.courseID){ lessonsList.push(schedule.value[element]); } } @@ -267,7 +267,7 @@ } const matrix = []; for (let element in lessons){ - if(lessons[element].course.courseId == course.courseId){ + if(lessons[element].course.courseID == course.courseID){ matrix.push(lessons[element]) } }