1
0
forked from PGL/Clyde

ready to PR

This commit is contained in:
Wawilski 2024-04-21 18:46:54 +02:00
parent 0d6b4ec57c
commit 172837d6d1
9 changed files with 12 additions and 12 deletions

View File

@ -27,6 +27,7 @@ dependencies {
implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0") implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0")
// implementation("org.springframework.session:spring-session-jdbc") // implementation("org.springframework.session:spring-session-jdbc")
developmentOnly("org.springframework.boot:spring-boot-devtools") developmentOnly("org.springframework.boot:spring-boot-devtools")
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
runtimeOnly("org.postgresql:postgresql") runtimeOnly("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers") testImplementation("org.springframework.boot:spring-boot-testcontainers")

View File

@ -88,7 +88,6 @@ public class CourseController {
{ {
if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)) if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
return new UnauthorizedResponse<>(null); return new UnauthorizedResponse<>(null);
System.out.println(course.getOwner().getRegNo());
Course createdCourse = courseServ.save(course); Course createdCourse = courseServ.save(course);
if (createdCourse == null) if (createdCourse == null)
return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST); return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);

View File

@ -103,7 +103,7 @@ public class LessonService {
case "lessonType": case "lessonType":
target.setLessonType((String) entry.getValue()); target.setLessonType((String) entry.getValue());
break; break;
case "courseId": case "courseID":
target.setCourse(courseRepo.findById((int) entry.getValue())); target.setCourse(courseRepo.findById((int) entry.getValue()));
break; break;
} }

View File

@ -50,7 +50,7 @@ public class ProtectionService {
HashMap<String ,Object> toReturn = new HashMap<>(); HashMap<String ,Object> toReturn = new HashMap<>();
toReturn.put("courseID",course.getCourseId()); toReturn.put("courseID",course.getCourseID());
toReturn.put("credits",course.getCredits()); toReturn.put("credits",course.getCredits());
toReturn.put("title", course.getTitle()); toReturn.put("title", course.getTitle());
toReturn.put("owner", userWithoutPassword(course.getOwner())); toReturn.put("owner", userWithoutPassword(course.getOwner()));

View File

@ -18,7 +18,7 @@ import org.hibernate.annotations.OnDeleteAction;
public class Course { public class Course {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int courseId; private int courseID;
private int credits; private int credits;
private String title; private String title;

View File

@ -64,13 +64,13 @@
async function patchCourse(course){ async function patchCourse(course){
for (let element in toModify){ for (let element in toModify){
if (element =="owner" && (toModify[element].regNo != course.owner.regNo)){ 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)){ else if(element == "title" && (toModify[element] != course.title)){
await alterCourse(course.courseId,{title:toModify[element]}); await alterCourse(course.courseId,{title:toModify[element]});
} }
else if(element == "credits" && (parseInt(toModify[element]) != course.credits)){ 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); toModify= Object.assign({},pattern);

View File

@ -142,7 +142,7 @@ async function askChanges(i){
<div style="margin-bottom:20px;"> <div style="margin-bottom:20px;">
{{i18n("course")}}: {{i18n("course")}}:
<select v-if="curriculum != null" v-model="toModify.course"> <select v-if="curriculum != null" v-model="toModify.course">
<option v-for="item in courses" :value='item.courseId'>{{item.title}}</option> <option v-for="item in courses" :value='item.courseID'>{{item.title}}</option>
</select> </select>
</div> </div>
<div style="margin-bottom:20px;"> <div style="margin-bottom:20px;">

View File

@ -55,7 +55,7 @@ const minDate = ref(invertedFormatDate((new Date()).setDate(currentDate.getDate(
} }
const lessonCreator = { const lessonCreator = {
"courseId" : null, "courseID" : null,
"lessonStart":null, "lessonStart":null,
"lessonEnd":null, "lessonEnd":null,
"lessonType":null, "lessonType":null,
@ -157,7 +157,7 @@ async function setCourses(){
} }
const matrix = []; const matrix = [];
for (let element in lessons){ for (let element in lessons){
if(lessons[element].course.courseId == course.courseId){ if(lessons[element].course.courseID == course.courseID){
matrix.push(lessons[element]) matrix.push(lessons[element])
} }
} }
@ -210,7 +210,7 @@ async function setCourses(){
lessonCreatorBuffer.value.color = lessonBuffer.value.color; lessonCreatorBuffer.value.color = lessonBuffer.value.color;
lessonCreatorBuffer.value.lessonType =lessonBuffer.value.lessonType; lessonCreatorBuffer.value.lessonType =lessonBuffer.value.lessonType;
lessonCreatorBuffer.value.local = lessonBuffer.value.local; lessonCreatorBuffer.value.local = lessonBuffer.value.local;
lessonCreatorBuffer.value.courseId = lessonBuffer.value.course.courseId; lessonCreatorBuffer.value.courseID = lessonBuffer.value.course.courseID;
await createLesson(lessonCreatorBuffer.value); await createLesson(lessonCreatorBuffer.value);

View File

@ -196,7 +196,7 @@
focus.value = element; focus.value = element;
var lessonsList = []; var lessonsList = [];
for (let element in schedule.value){ 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]); lessonsList.push(schedule.value[element]);
} }
} }
@ -267,7 +267,7 @@
} }
const matrix = []; const matrix = [];
for (let element in lessons){ for (let element in lessons){
if(lessons[element].course.courseId == course.courseId){ if(lessons[element].course.courseID == course.courseID){
matrix.push(lessons[element]) matrix.push(lessons[element])
} }
} }