From d4c442c64a032285d8f3d3f0772d64cd490f8a8b Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Wed, 17 Apr 2024 12:40:52 +0200 Subject: [PATCH] added ResearchProfile to Apps (to be changed) --- .../ovh/herisson/Clyde/EndPoints/ApplicationsController.java | 1 + .../main/java/ovh/herisson/Clyde/Tables/Applications.java | 2 ++ .../src/rest/ScientificPublications/ResearcherProfile.js | 5 +++-- frontend/src/rest/apps.js | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java index d4fdaa0..f99fd60 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java @@ -47,6 +47,7 @@ public class ApplicationsController { //if unAuthed authorizedApps.add(Applications.Login); + authorizedApps.add(Applications.ResearcherProfile); User user = authServ.getUserFromToken(token); if(user == null) diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java index 5c39891..27c299e 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java @@ -19,5 +19,7 @@ public enum Applications { // InscriptionService authorization Requests, + // profile of a researcher + ResearcherProfile, StudentsList } diff --git a/frontend/src/rest/ScientificPublications/ResearcherProfile.js b/frontend/src/rest/ScientificPublications/ResearcherProfile.js index 827311d..29fbe27 100644 --- a/frontend/src/rest/ScientificPublications/ResearcherProfile.js +++ b/frontend/src/rest/ScientificPublications/ResearcherProfile.js @@ -12,9 +12,10 @@ export async function fetchStats(id){ return restGet("/stats/" +id) } export async function addView(url){ - return restPost("/addView/" +url) + return restPost("/addview/" +url) } export async function getFile(url){ - return restGet("/" + url) + const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api" + await fetch(restURL + "/"+url, {method: "GET"}) } \ No newline at end of file diff --git a/frontend/src/rest/apps.js b/frontend/src/rest/apps.js index 59d3c76..8ccba3a 100644 --- a/frontend/src/rest/apps.js +++ b/frontend/src/rest/apps.js @@ -34,6 +34,7 @@ const appsList = { 'ManageCourses': { path: '#/manage-courses', icon: 'fa-book', text: i18n("app.manage.courses") }, 'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")}, 'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")}, + 'ResearcherProfile':{path:'#/researcher-profile',icon:'fa-book-bookmark',text:"hihi"}, } const currentPath = ref(window.location.hash)