Login and register ok and starting requests
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/0b6b478c-9b05-4190-a7f3-c6414135c236.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/10217f04-10cf-412f-87d7-aa427bfe0de5.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/2a18cb2c-a675-4f54-a25b-e6099547d24d.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/3af9e590-794a-401f-8dce-97437ee4a2eb.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/8f4e3a22-1261-4afd-b226-c00bd74f02ed.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/912f2a1e-d331-4fc6-9cc5-c5ef2f1d8e9d.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
							
								
								
									
										
											BIN
										
									
								
								backend/cdn/fa7deac8-a4db-4f1a-8b2e-0f1388c81045.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 29 KiB | 
| @ -63,7 +63,7 @@ public class InscriptionController { | |||||||
|                                                                  @RequestHeader("Authorization") String token, |                                                                  @RequestHeader("Authorization") String token, | ||||||
|                                                                  @RequestBody RequestState requestState) |                                                                  @RequestBody RequestState requestState) | ||||||
|     { |     { | ||||||
|  |         System.out.println(requestState); | ||||||
|         if (authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token)) |         if (authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token)) | ||||||
|             return new UnauthorizedResponse<>(null); |             return new UnauthorizedResponse<>(null); | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| <script setup> | <script setup> | ||||||
|   import i18n from "@/i18n.js" |   import i18n from "@/i18n.js" | ||||||
|   import Req from "./Request.vue" |  | ||||||
|   import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js' |   import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js' | ||||||
|  |  | ||||||
|   const requests_example = await getAllRegisters(); |   const requests_example = await getAllRegisters(); | ||||||
| @ -18,8 +17,8 @@ | |||||||
|     <div class="surname"><a>{{item.lastName}}</a></div> |     <div class="surname"><a>{{item.lastName}}</a></div> | ||||||
|     <div class="firstname"><a>{{item.firstName}}</a></div> |     <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="infos"><button style="background-color:rgb(105,05,105);" >{{i18n("request.moreInfos")}}</button></div> | ||||||
|     <div class="accept"><button @click="validateRegister(id,Accepted)" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</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(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> |   </div> | ||||||
|   </div> |   </div> | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| <script setup> | <script setup> | ||||||
|   import { ref } from 'vue' |   import {reactive, ref } from 'vue' | ||||||
|   import i18n from '@/i18n.js' |   import i18n from '@/i18n.js' | ||||||
|   import { login , register , disconnect, isLogged} from '@/rest/Users.js' |   import { login , register , disconnect, isLogged} from '@/rest/Users.js' | ||||||
|   import { getAllCurriculums } from '@/rest/curriculum.js' |   import { getAllCurriculums } from '@/rest/curriculum.js' | ||||||
| @ -10,17 +10,20 @@ | |||||||
|  |  | ||||||
|   const loginPage= ref(true) |   const loginPage= ref(true) | ||||||
|   const page = ref(0) |   const page = ref(0) | ||||||
|  |    | ||||||
|  |   const outputs = reactive({ | ||||||
|  |     surname:null, | ||||||
|  |     firstname:null, | ||||||
|  |     password:null, | ||||||
|  |     birthday:null, | ||||||
|  |     email:null, | ||||||
|  |     address:null, | ||||||
|  |     country:null, | ||||||
|  |     curriculum:null, | ||||||
|  |   }) | ||||||
|  |  | ||||||
|   const submitValue= ref(i18n("login.guest.submit")) |   const submitValue= ref(i18n("login.guest.submit")) | ||||||
|   const surname=ref("") |  | ||||||
|   const firstname=ref("") |  | ||||||
|   const password=ref("") |  | ||||||
|   const passwordConfirm=ref("") |   const passwordConfirm=ref("") | ||||||
|   const birthday=ref("") |  | ||||||
|   const email=ref("") |  | ||||||
|   const address=ref("") |  | ||||||
|   const country=ref("") |  | ||||||
|   let curriculum; |  | ||||||
|   |   | ||||||
|   const imageSaved = ref(false) |   const imageSaved = ref(false) | ||||||
|   const ppData = ref(false) |   const ppData = ref(false) | ||||||
| @ -32,8 +35,9 @@ | |||||||
|       window.location.href="#/home"; |       window.location.href="#/home"; | ||||||
|       }, "500"); |       }, "500"); | ||||||
|  }  |  }  | ||||||
|   function verifyInputs(){ |   function verifyInputs(pass){ | ||||||
|     if(password.value==passwordConfirm.value){ |     console.log(pass) | ||||||
|  |     if(pass==passwordConfirm.value){ | ||||||
|       page.value++; |       page.value++; | ||||||
|       return toast('Password and Confirm Password are correct.', { |       return toast('Password and Confirm Password are correct.', { | ||||||
|        |        | ||||||
| @ -56,17 +60,17 @@ | |||||||
|       <div class='loginBox'> |       <div class='loginBox'> | ||||||
|  |  | ||||||
|         <div v-if="loginPage"> |         <div v-if="loginPage"> | ||||||
|           <form @submit.prevent=" login(email,password);goBackHome();"class="form"> |           <form @submit.prevent=" login(outputs.email,outputs.password);goBackHome();"class="form"> | ||||||
|             <h1 style="color:rgb(239,60,168); font-family: sans-serif;"> |             <h1 style="color:rgb(239,60,168); font-family: sans-serif;"> | ||||||
|               {{i18n("login.guest.signin")}} |               {{i18n("login.guest.signin")}} | ||||||
|             </h1> |             </h1> | ||||||
|             <div class="inputBox"> |             <div class="inputBox"> | ||||||
|               <p>ID / {{i18n("login.guest.email")}}</p>  |               <p>ID / {{i18n("login.guest.email")}}</p>  | ||||||
|               <input type="text" v-model="email"> |               <input type="text" v-model="outputs.email"> | ||||||
|             </div> |             </div> | ||||||
|             <div class="inputBox"> |             <div class="inputBox"> | ||||||
|               <p>{{i18n("login.guest.password")}}</p> |               <p>{{i18n("login.guest.password")}}</p> | ||||||
|               <input type="password" v-model="password"> |               <input type="password" v-model="outputs.password"> | ||||||
|             </div> |             </div> | ||||||
|             <div class="register"> |             <div class="register"> | ||||||
|               <a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a> |               <a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a> | ||||||
| @ -85,19 +89,19 @@ | |||||||
|             <div v-if="page === 0"> |             <div v-if="page === 0"> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.surname")}}</p> |                 <p>{{i18n("login.guest.surname")}}</p> | ||||||
|                 <input type="text" v-model="surname"> |                 <input type="text" v-model="outputs.surname"> | ||||||
|               </div> |               </div> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.firstname")}}</p> |                 <p>{{i18n("login.guest.firstname")}}</p> | ||||||
|                 <input type="text" v-model="firstname"> |                 <input type="text" v-model="outputs.firstname"> | ||||||
|               </div> |               </div> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.birthday")}}</p> |                 <p>{{i18n("login.guest.birthday")}}</p> | ||||||
|                 <input type="date" v-model="birthday"> |                 <input type="date" v-model="outputs.birthday"> | ||||||
|               </div> |               </div> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                  <p>{{i18n("login.guest.password")}}</p> |                  <p>{{i18n("login.guest.password")}}</p> | ||||||
|                  <input type="password" v-model="password"> |                  <input type="password" v-model="outputs.password"> | ||||||
|               </div> |               </div> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.confirm")}} {{i18n("login.guest.password")}}</p> |                 <p>{{i18n("login.guest.confirm")}} {{i18n("login.guest.password")}}</p> | ||||||
| @ -105,7 +109,7 @@ | |||||||
|               </div> |               </div> | ||||||
|                |                | ||||||
|               <div class="switchpage"> |               <div class="switchpage"> | ||||||
|                 <button @click="verifyInputs();">{{i18n("login.guest.nextpage")}}</button> |                 <button @click="verifyInputs(outputs.password);">{{i18n("login.guest.nextpage")}}</button> | ||||||
|  |  | ||||||
|               </div> |               </div> | ||||||
|               <div @click="(loginPage=!loginPage) && (page=0)" class="register"> |               <div @click="(loginPage=!loginPage) && (page=0)" class="register"> | ||||||
| @ -115,15 +119,15 @@ | |||||||
|             <div v-else> |             <div v-else> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.email")}}</p> |                 <p>{{i18n("login.guest.email")}}</p> | ||||||
|                 <input type="mail" v-model="email"> |                 <input type="mail" v-model="outputs.email"> | ||||||
|               </div> |               </div> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.address")}}</p> |                 <p>{{i18n("login.guest.address")}}</p> | ||||||
|                 <input type="text" v-model="address"> |                 <input type="text" v-model="outputs.address"> | ||||||
|               </div> |               </div> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("login.guest.country")}}</p> |                 <p>{{i18n("login.guest.country")}}</p> | ||||||
|                 <input type="text" v-model="country"> |                 <input type="text" v-model="outputs.country"> | ||||||
|               </div> |               </div> | ||||||
|               <form novalidate enctype="multipart/form-data" class="inputBox"> |               <form novalidate enctype="multipart/form-data" class="inputBox"> | ||||||
|               	<p>{{i18n("profile.picture").toUpperCase()}}</p>  |               	<p>{{i18n("profile.picture").toUpperCase()}}</p>  | ||||||
| @ -131,13 +135,13 @@ | |||||||
|               </form> |               </form> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("Curriculum").toUpperCase()}}</p>  |                 <p>{{i18n("Curriculum").toUpperCase()}}</p>  | ||||||
|                   <select v-model="curriculum"> |                   <select v-model="outputs.curriculum"> | ||||||
|                     <option v-for="item in curricula">{{item.curriculumId}}</option> |                     <option v-for="item in curricula">{{item.curriculumId}}</option> | ||||||
|                      |                      | ||||||
|                   </select> |                   </select> | ||||||
|               </div> |               </div> | ||||||
|               <div style="align-self:center;" class="inputBox"> |               <div style="align-self:center;" class="inputBox"> | ||||||
|                 <button style="margin-top:25px;" @click="console.log(curriculum);register(firstname, surname, birthday, password, mail, address, country, curriculum);"> |                 <button style="margin-top:25px;" @click="console.log(outputs);register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData);"> | ||||||
|                   {{i18n("login.guest.submit")}} |                   {{i18n("login.guest.submit")}} | ||||||
|                 </button> |                 </button> | ||||||
|               </div> |               </div> | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ | |||||||
|  * |  * | ||||||
|  * TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future. |  * 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 |  * create a new register requests that can be recovered by the registering service | ||||||
| @ -41,5 +41,5 @@ export async function getAllRegisters(){ | |||||||
|  * Change the state of a requests. |  * Change the state of a requests. | ||||||
|  */ |  */ | ||||||
| export async function validateRegister(id, state){ | export async function validateRegister(id, state){ | ||||||
| 	return restPatch("/request/register/" + id, {state: state}); |   return restPatch("/request/register/" + id, state); | ||||||
| } | } | ||||||
|  | |||||||
| @ -28,14 +28,15 @@ export function disconnect(){ | |||||||
|  */ |  */ | ||||||
| export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId){ | export async function register(firstname, lastname, birthDate, password, email, address, country, curriculumId, imageId){ | ||||||
| 	return restPost("/register", { | 	return restPost("/register", { | ||||||
| 		firstname: firstname, | 		firstName: firstname, | ||||||
| 		lastname: lastname, | 		lastName: lastname, | ||||||
| 		birthDate: birthDate, | 		birthDate: birthDate, | ||||||
| 		password: password, | 		password: password, | ||||||
| 		email: email, | 		email: email, | ||||||
| 		address: address, | 		address: address, | ||||||
| 		country: country, | 		country: country, | ||||||
| 		curriculumId: curriculumId | 		curriculumId: curriculumId, | ||||||
|  |     profilePictureUrl: imageId, | ||||||
| 	}); | 	}); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
| @ -11,6 +11,7 @@ export async function restPost(endPoint, data) { | |||||||
| 	return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)}); | 	return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)}); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| export async function restPostFile(endPoint, file){ | export async function restPostFile(endPoint, file){ | ||||||
| 	let headers = new Headers(); | 	let headers = new Headers(); | ||||||
| 	return await _rest(endPoint, {method: "POST", credentials: 'include', body: file, headers: 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)}); | 	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 |  * backbone for the request made by the frontend | ||||||
|  * |  * | ||||||
|  | |||||||