diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java index e88c759..a8a87ce 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/Inscription/ExternalCurriculumController.java @@ -30,9 +30,16 @@ public class ExternalCurriculumController { //everyone can post some externalcurriculums (the validity of the elements is assured by the inscription service) @PostMapping("/externalcurriculum") public ResponseEntity postExternalCurriculum(@RequestBody Map externalCurrInfos){ - InscriptionRequest ir = inscriptionRepository.findById((Integer) externalCurrInfos.get("inscriptionRequestId")); + //An external curriculum can either be linked to an User or to an InscriptionRequest + InscriptionRequest ir = null; + User user = null; + if (externalCurrInfos.get("inscriptionRequestId") != null){ + ir = inscriptionRepository.findById((Integer) externalCurrInfos.get("inscriptionRequestId")); + }else{ + user = userRepository.findById((Integer) externalCurrInfos.get("userRegNo")); + } - ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifDocUrl"), null); + ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifDocUrl"), user); return new ResponseEntity<>(ecr.save(toSave), HttpStatus.OK); } diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java index 3d75d2a..6ff0707 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java @@ -76,6 +76,9 @@ public class MockController { userService.saveAll(mockUsers); + ExternalCurriculum externalCurriculum = new ExternalCurriculum(null, "HEH", "Bachelier en ingénieur", "completed", 2015, 2017, null, joe); + externalCurriculumRepository.save(externalCurriculum); + Minerval minerval = new Minerval(joe.getRegNo(), 0, 852, 2023); minervalRepository.save(minerval); // Course / Curriculum part @@ -133,7 +136,7 @@ public class MockController { UnregisterRequest unregisterRequest = new UnregisterRequest(RequestState.Pending, "je veux partir", new Date(), joe.getRegNo(), joe.getFirstName(), joe.getLastName(), joe.getEmail(), null); uninscriptionRequestRepository.save(unregisterRequest); - ExternalCurriculum externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null); + externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null); externalCurriculumRepository.save(externalCurriculum); } } diff --git a/frontend/src/Apps/Inscription/AboutStudent.vue b/frontend/src/Apps/Inscription/AboutStudent.vue index 54d81fc..91fb89f 100644 --- a/frontend/src/Apps/Inscription/AboutStudent.vue +++ b/frontend/src/Apps/Inscription/AboutStudent.vue @@ -88,7 +88,7 @@
- +
diff --git a/frontend/src/Apps/Inscription/ExternalCurriculumList.vue b/frontend/src/Apps/Inscription/ExternalCurriculumList.vue index a642840..eba1cdf 100644 --- a/frontend/src/Apps/Inscription/ExternalCurriculumList.vue +++ b/frontend/src/Apps/Inscription/ExternalCurriculumList.vue @@ -1,25 +1,91 @@ diff --git a/frontend/src/Apps/Login.vue b/frontend/src/Apps/Login.vue index dbac9e3..705012f 100644 --- a/frontend/src/Apps/Login.vue +++ b/frontend/src/Apps/Login.vue @@ -100,7 +100,7 @@