From 17d0ae7ccc4d7f39ea301c0bec7b6c3b8ba34b49 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 16 Mar 2024 10:17:04 +0100 Subject: [PATCH] Refactoring: cursus -> curriculum frontend I hope I didn't missed anything, this commit is following the previous one in this branch --- frontend/src/Apps/Login.vue | 6 ++-- frontend/src/Apps/ManageCourses.vue | 18 +++++------ frontend/src/Apps/Profil.vue | 4 +-- frontend/src/Apps/Request.vue | 2 +- frontend/src/rest/ServiceInscription.js | 2 +- frontend/src/rest/Users.js | 6 ++-- frontend/src/rest/curriculum.js | 41 +++++++++++++++++++++++++ frontend/src/rest/cursus.js | 41 ------------------------- 8 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 frontend/src/rest/curriculum.js delete mode 100644 frontend/src/rest/cursus.js diff --git a/frontend/src/Apps/Login.vue b/frontend/src/Apps/Login.vue index a5043e8..73b4f81 100644 --- a/frontend/src/Apps/Login.vue +++ b/frontend/src/Apps/Login.vue @@ -16,7 +16,7 @@ const email=ref("") const address=ref("") const country=ref("") - const cursus=ref("") + const curriculum=ref("") const imageSaved = ref(false) const ppData = ref(false) @@ -49,7 +49,7 @@
-
+

{{i18n("login.guest.welcome")}}

@@ -103,7 +103,7 @@

{{i18n("curriculum").toUpperCase()}}

- diff --git a/frontend/src/Apps/ManageCourses.vue b/frontend/src/Apps/ManageCourses.vue index 5827e52..0a3fe27 100644 --- a/frontend/src/Apps/ManageCourses.vue +++ b/frontend/src/Apps/ManageCourses.vue @@ -1,7 +1,7 @@ @@ -130,7 +130,7 @@ const cursus=[
{{i18n("courses.toDelete")}} :
@@ -147,7 +147,7 @@ const cursus=[
-
+
+ v-for="item in user.curriculum">
{{item.name}}
{{item.teacher}}
diff --git a/frontend/src/Apps/Request.vue b/frontend/src/Apps/Request.vue index 4d63464..3e0eec4 100644 --- a/frontend/src/Apps/Request.vue +++ b/frontend/src/Apps/Request.vue @@ -8,7 +8,7 @@ address: String, country: String, birthDate: String, - cursus:String, + curriculum:String, degree:String,}); diff --git a/frontend/src/rest/ServiceInscription.js b/frontend/src/rest/ServiceInscription.js index 5068217..1f75123 100644 --- a/frontend/src/rest/ServiceInscription.js +++ b/frontend/src/rest/ServiceInscription.js @@ -24,7 +24,7 @@ export async function createRegister(){ * - country * - birthdate * - email - * - cursus + * - curriculum * - degree */ export async function getRegisters(id){ diff --git a/frontend/src/rest/Users.js b/frontend/src/rest/Users.js index b786f0d..17420b5 100644 --- a/frontend/src/rest/Users.js +++ b/frontend/src/rest/Users.js @@ -14,10 +14,10 @@ export async function login(user, pass, exp){ * @param mail * @param address * @param country - * @param cursus + * @param curriculum * @param imageId id of the image in database returned when uploaded */ -export async function register(firstname, lastname, birthDate, password, email, address, country, cursus, imageId){ +export async function register(firstname, lastname, birthDate, password, email, address, country, curriculum, imageId){ return restPost("/register", { firstname: firstname, lastname: lastname, @@ -26,7 +26,7 @@ export async function register(firstname, lastname, birthDate, password, email, email: email, address: address, country: country, - cursus: cursus + curriculum: curriculum }); } diff --git a/frontend/src/rest/curriculum.js b/frontend/src/rest/curriculum.js new file mode 100644 index 0000000..4aa6d8f --- /dev/null +++ b/frontend/src/rest/curriculum.js @@ -0,0 +1,41 @@ +/** + * curriculum API + */ + +import { restGet, restPostn, restDelete, restPatch } from './restConsumer.js' + +/** + * Create a new curriculum (bundle of courses) + * @param courses list of courses + */ +export async function createcurriculum(courses){ + return restPost("/curriculum", {courses: courses} ); +} + +/** + * Delete the specified curriculum + */ +export async function deletecurriculum(id){ + return restDelete("/curriculum/" + id); +} + +/** + * Get informations on a particular curriculum + * + * @param id identification of the curriculum + * + * @return list of courses + */ +export async function getcurriculum(id){ + return restGet("/curriculum/" + id); +} + +/** + * Modify the courses of a curriculum + * + * @param id the id of the curriculum + * @param courses list of new courses + */ +export async function altercurriculum(id, courses){ + return restPatch("/curriculum/" + id, courses); +} diff --git a/frontend/src/rest/cursus.js b/frontend/src/rest/cursus.js deleted file mode 100644 index 5aad5be..0000000 --- a/frontend/src/rest/cursus.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * cursus API - */ - -import { restGet, restPostn, restDelete, restPatch } from './restConsumer.js' - -/** - * Create a new cursus (bundle of courses) - * @param courses list of courses - */ -export async function createCursus(courses){ - return restPost("/cursus", {courses: courses} ); -} - -/** - * Delete the specified cursus - */ -export async function deleteCursus(id){ - return restDelete("/cursus/" + id); -} - -/** - * Get informations on a particular cursus - * - * @param id identification of the cursus - * - * @return list of courses - */ -export async function getCursus(id){ - return restGet("/cursus/" + id); -} - -/** - * Modify the courses of a cursus - * - * @param id the id of the cursus - * @param courses list of new courses - */ -export async function alterCursus(id, courses){ - return restPatch("/cursus/" + id, courses); -}