Merge branch 'master' into tonitch/feat/notifications
This commit is contained in:
@ -26,7 +26,7 @@ export function disconnect(){
|
||||
* @param curriculum
|
||||
* @param imageId id of the image in database returned when uploaded
|
||||
*/
|
||||
export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId, identityCardId, submissionDate, equivalence){
|
||||
export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId, identityCardId, submissionDate, equivalence,admissionDocUrl){
|
||||
return restPost("/register", {
|
||||
firstName: firstname,
|
||||
lastName: lastname,
|
||||
@ -39,7 +39,8 @@ export async function register(firstname, lastname, birthDate, password, email,
|
||||
profilePicture: imageId,
|
||||
identityCard : identityCardId,
|
||||
submissionDate : submissionDate,
|
||||
equivalenceState : equivalence
|
||||
equivalenceState : equivalence,
|
||||
admissionDocUrl: admissionDocUrl
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,13 +4,13 @@ import i18n from '@/i18n.js'
|
||||
|
||||
// Liste des apps
|
||||
import LoginPage from '@/Apps/Login.vue'
|
||||
import Inscription from "@/Apps/Inscription/ManageRequests.vue"
|
||||
import Profil from "@/Apps/Profil.vue"
|
||||
import Courses from "@/Apps/ManageCourses.vue"
|
||||
import Users from "@/Apps/UsersList.vue"
|
||||
import Students from "@/Apps/StudentsList.vue"
|
||||
import AboutStudent from "@/Apps/Inscription/AboutStudent.vue";
|
||||
import Msg from "@/Apps/Msg.vue"
|
||||
import Forums from '@/Apps/Forums.vue'
|
||||
import Payments from "@/Apps/Inscription/PaymentInfo.vue";
|
||||
import ManageRequests from "@/Apps/Inscription/ManageRequests.vue";
|
||||
|
||||
const apps = {
|
||||
@ -21,17 +21,20 @@ const apps = {
|
||||
'/users-list' : Users,
|
||||
'/students-list' : Students,
|
||||
'/msg' : Msg,
|
||||
'/forums': Forums,
|
||||
'/payments': Payments
|
||||
}
|
||||
|
||||
const appsList = {
|
||||
'Msg': { path: '#/msg', icon: 'fa-comment', text: i18n("app.messages") },
|
||||
'Notification': { path: '#/notifs', icon: 'fa-bell', text: i18n("app.notifications") },
|
||||
'Forum': { path: '#/forum', icon: 'fa-envelope', text: i18n("app.forum") },
|
||||
'Forum': { path: '#/forums', icon: 'fa-envelope', text: i18n("app.forum") },
|
||||
'Schedule': { path: '#/schedule', icon: 'fa-calendar-days', text: i18n("app.schedules") },
|
||||
'Requests': { path: '#/requests', icon: 'fa-users', text: "Requests" },
|
||||
'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")},
|
||||
'Payments':{path: '#/payments', icon:'fa-users', text:i18n("app.payments")}
|
||||
}
|
||||
|
||||
const currentPath = ref(window.location.hash)
|
||||
|
@ -71,3 +71,11 @@ export async function getCourses(role){
|
||||
export async function alterCourse(id, changes){
|
||||
return restPatch("/course/" + id, changes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list containing all the actual courses of a user
|
||||
*/
|
||||
|
||||
export async function getUserActualCourses(){
|
||||
return restGet("/usercourses")
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import {restGet, restPatch, restPost} from "@/rest/restConsumer.js";
|
||||
import {parseInteger} from "jsdom/lib/jsdom/living/helpers/strings.js";
|
||||
|
||||
export async function createExternalCurriculum(inscriptionRequestId,school, formation, completion, startYear, endYear, justifdocUrl){
|
||||
export async function createExternalCurriculum(inscriptionRequestId,school, formation, completion, startYear, endYear, justifdocUrl, userRegNo){
|
||||
return restPost("/externalcurriculum", {
|
||||
inscriptionRequestId: inscriptionRequestId,
|
||||
school:school,
|
||||
formation :formation,
|
||||
completion : completion,
|
||||
startYear : parseInteger(startYear),
|
||||
endYear: parseInteger(endYear),
|
||||
justifdocUrl : justifdocUrl
|
||||
startYear : startYear,
|
||||
endYear: endYear,
|
||||
justifdocUrl : justifdocUrl,
|
||||
userRegNo : userRegNo
|
||||
})
|
||||
}
|
||||
|
||||
|
50
frontend/src/rest/forum.js
Normal file
50
frontend/src/rest/forum.js
Normal file
@ -0,0 +1,50 @@
|
||||
/*******************************************************
|
||||
* File: forum.js
|
||||
* Author: Anthony Debucquoy
|
||||
* Scope: Extension messagerie
|
||||
* Description: Forum related functions and calls
|
||||
*******************************************************/
|
||||
|
||||
import { ref } from 'vue'
|
||||
import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
|
||||
|
||||
/**
|
||||
* List forums of a course
|
||||
*/
|
||||
export async function getForumsOfCourse(id){
|
||||
ForumsOfCurrentCourse.value = await restGet("/forums/" + id)
|
||||
}
|
||||
|
||||
export const ForumsOfCurrentCourse = ref();
|
||||
|
||||
export function createForum(id, name){
|
||||
restPost("/forums/" + id, {name: name}).then(_ => getForumsOfCourse(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* List post of a specified forum
|
||||
*/
|
||||
export async function getPostsOfForum(id){
|
||||
if(id != null){
|
||||
PostsOfCurrentForum.value = await restGet("/forum/" + id);
|
||||
}
|
||||
}
|
||||
|
||||
export function createPost(id, subject, content){
|
||||
restPost("/forum/" + id, {subject: subject, content: content}).then(_ => getPostsOfForum(id));
|
||||
}
|
||||
|
||||
export const PostsOfCurrentForum = ref();
|
||||
|
||||
/**
|
||||
* Get a post and its responses
|
||||
*/
|
||||
export async function fetchPost(id){
|
||||
fetchedPost.value = await restGet("/forum/post/" + id);
|
||||
}
|
||||
|
||||
export function sendAnswer(id, content){
|
||||
restPost("/forum/post/" + id, {content: content}).then(_ => fetchPost(id))
|
||||
}
|
||||
|
||||
export const fetchedPost = ref();
|
@ -20,6 +20,62 @@ export async function editEquivalenceState(id, newstate){
|
||||
return restPatch("/request/registerequiv/"+id+"/"+newstate)
|
||||
}
|
||||
|
||||
export async function addUninscReq(userId, reason){
|
||||
return restPost("/uninscriptionreq", {"userId" : userId, "reason" : reason})
|
||||
export async function addUninscReq(userId, reason, curriculumId){
|
||||
return restPost("/unregister", {"userId" : userId, "reason" : reason, "curriculumId":curriculumId})
|
||||
}
|
||||
|
||||
export async function editScholarshipReq(body){
|
||||
return restPatch("/scholarshipreq/", body)
|
||||
}
|
||||
|
||||
export async function getScholarshipReqById(id){
|
||||
return restGet("/scholarshipreq/"+id)
|
||||
}
|
||||
|
||||
export async function getAllUnregisters(){
|
||||
return restGet("/unregister")
|
||||
}
|
||||
|
||||
export async function getUnregisterbyId(id){
|
||||
return restGet("/unregister/"+id)
|
||||
}
|
||||
|
||||
export async function editUnregReq(id, newstate){
|
||||
return restPatch("/unregister/"+id+"/"+newstate)
|
||||
}
|
||||
|
||||
export async function getAllPayments(){
|
||||
return restGet("/payment")
|
||||
}
|
||||
|
||||
export async function postChangeCurrReq(item){
|
||||
return restPost("/changecurriculumreq", item)
|
||||
}
|
||||
|
||||
export async function getAllChangeCurrReq(){
|
||||
return restGet("/changecurriculumreq")
|
||||
}
|
||||
|
||||
export async function getChangeCurrReqById(id){
|
||||
return restGet("/changecurriculumreq/"+id)
|
||||
}
|
||||
|
||||
export async function editChangeCurrReq(id, newState){
|
||||
return restPatch("/changecurriculumreq/"+id+"/"+newState)
|
||||
}
|
||||
|
||||
export async function editChangeCurrReqTeacherState(id, newState){
|
||||
return restPatch("/changecurriculumreqteacher/"+id+"/"+newState)
|
||||
}
|
||||
|
||||
export async function getExempReq(id){
|
||||
return restGet("/exemptionsreq/"+id)
|
||||
}
|
||||
|
||||
export async function editExempReqState(id, newstate){
|
||||
return restPatch("/exemptionsreq/"+id+"/"+newstate)
|
||||
}
|
||||
|
||||
export async function getExempByUser(userId){
|
||||
return restGet("/exemptionreq/"+userId)
|
||||
}
|
@ -13,11 +13,11 @@ export async function uploadProfilePicture(file){
|
||||
|
||||
|
||||
/**
|
||||
* More generic version of the upload method
|
||||
* More generic version of the uploadProfilePicture method
|
||||
*/
|
||||
|
||||
export async function uploadFile(file, type){
|
||||
const formData = new FormData();
|
||||
formData.append("file", file[0]);
|
||||
return restPostFile("/upload/"+type, formData)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user