Compare commits
No commits in common. "73d50f3f50d54a4d2e55afe323117ca730b954d5" and "a762b6875de058dbc426d81e2e4f7d3d37fce4f2" have entirely different histories.
73d50f3f50
...
a762b6875d
@ -57,6 +57,7 @@ public class InscriptionController {
|
||||
@RequestHeader("Authorization") String token,
|
||||
@RequestBody RequestState state)
|
||||
{
|
||||
System.out.println(requestState);
|
||||
if (authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<template>
|
||||
<div v-for="item of requests_example">
|
||||
<div class="bodu" v-if="item.state === 'Pending'">
|
||||
<div class="bodu">
|
||||
<div class="container">
|
||||
|
||||
<div class="id"><a>{{item.id}}</a></div>
|
||||
@ -18,7 +18,7 @@
|
||||
<div class="firstname"><a>{{item.firstName}}</a></div>
|
||||
<div class="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}}</button></div>
|
||||
<div class="accept"><button @click="validateRegister(item.id,'Accepted')" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
||||
<div class="refuse"><button @click="validateRegister(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
||||
<div class="refuse"><button @click="validateRegister(item.id,Refused)" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,9 +47,6 @@
|
||||
if (!isnull){
|
||||
createCourse(toAdd.title,toAdd.credits,toAdd.owner);
|
||||
toAdd= Object.assign({},pattern);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, "250");
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,26 +64,22 @@
|
||||
|
||||
function patchCourse(course){
|
||||
for (let element in toModify){
|
||||
console.log(toModify,1)
|
||||
console.log(toModify[element],2)
|
||||
console.log(course.credits)
|
||||
|
||||
if (element =="owner" && (toModify[element].regNo != course.owner.regNo)){
|
||||
if (element =="owner" && (toModify[element] != course.owner.regNo)){
|
||||
alterCourse(course.courseId,{owner:toModify[element].regNo});
|
||||
}
|
||||
else if(element == "title" && (toModify[element] != course.title)){
|
||||
alterCourse(course.courseId,{title:toModify[element]});
|
||||
}
|
||||
else if(element == "credits" && (parseInt(toModify[element]) != course.credits)){
|
||||
alterCourse(course.courseId,{credits:parseInt(toModify[element])});
|
||||
else if(element == "credits" && (toModify[element] != course.credits)){
|
||||
alterCourse(course.courseId,{credits:toModify[element]});
|
||||
}
|
||||
console.log(toModify[element])
|
||||
|
||||
|
||||
|
||||
}toModify = Object.assign({},pattern);
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, "500");
|
||||
}
|
||||
//Juste pour montrer le Delete Mode
|
||||
let toRemove;
|
||||
@ -99,7 +92,7 @@
|
||||
<template>
|
||||
<div class="body">
|
||||
<div v-if="!deleteMod && !createMod && (self.role !== 'Teacher')" class="listTitle buttonGrid">
|
||||
<button class="create" @click="editElementID= '';createMod = true;">
|
||||
<button class="create" @click="createMod = true">
|
||||
{{i18n("courses.createCourse")}}
|
||||
</button>
|
||||
<button class="delete" @click="deleteMod=true" >
|
||||
@ -115,7 +108,7 @@
|
||||
<div style="margin-bottom:20px;">
|
||||
{{i18n("Teacher")}} :
|
||||
<select style="max-width:200px;" class="teacher" v-model="toAdd.owner">
|
||||
<option v-for="item in profList" :value="item">{{item.lastName}}</option>
|
||||
<option v-for="item in profList">{{item}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-bottom:20px;">
|
||||
@ -168,7 +161,7 @@
|
||||
<div class="containerElement"v-else>
|
||||
<input style="max-width:200px;" class="name" v-model="toModify.title">
|
||||
<select v-if="self.role === 'Secretary'" style="max-width:200px;" class="teacher" v-model="toModify.owner">
|
||||
<option v-for="(item,index) in profList" :value='item'>{{item.lastName}}</option>
|
||||
<option v-for="item in profList">{{item.lastName}}</option>
|
||||
</select>
|
||||
<div v-else class="teacher">{{item.owner.lastName}}</div>
|
||||
<input v-if="self.role==='Secretary'"style="max-width:100px;"class="credits" v-model="toModify.credits">
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
|
||||
*/
|
||||
import {restGet, restPatch} from './restConsumer.js'
|
||||
import {restGet, restPatch,restPatchInfo} from './restConsumer.js'
|
||||
|
||||
/**
|
||||
* create a new register requests that can be recovered by the registering service
|
||||
|
@ -7,10 +7,8 @@ import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
|
||||
/**
|
||||
* Create a new course
|
||||
*/
|
||||
export async function createCourse(name, credits, owner){
|
||||
console.log(owner);
|
||||
|
||||
return restPost("/course", {title: name, credits: credits, owner} )
|
||||
export async function createCourse(name, credits, teacher){
|
||||
return restPost("/course", {title: name, credits: credits, owner: teacher} )
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,7 @@ export async function restPost(endPoint, data) {
|
||||
return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)});
|
||||
}
|
||||
|
||||
|
||||
export async function restPostFile(endPoint, file){
|
||||
let headers = new Headers();
|
||||
return await _rest(endPoint, {method: "POST", credentials: 'include', body: file, headers: headers });
|
||||
@ -24,6 +25,10 @@ export async function restPatch(endPoint, data) {
|
||||
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(data)});
|
||||
}
|
||||
|
||||
export async function restPatchInfo(endPoint, data){
|
||||
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: data});
|
||||
}
|
||||
|
||||
/**
|
||||
* backbone for the request made by the frontend
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user