Fetch inscription on backend
This commit is waiting for the backend implementation to be merged. The list of field expected is writen in comment
This commit is contained in:
		| @ -1,32 +1,10 @@ | |||||||
| <script setup> | <script setup> | ||||||
|   import Req from "./Request.vue" |   import Req from "./Request.vue" | ||||||
|   const requests_example = [ { |   import { getRegisters } from '@/rest/ServiceInscription.js' | ||||||
|   id:0, |  | ||||||
|   type:"Inscription", |   const requests_example = getRegisters(); | ||||||
|   lastName:"DoefenschmirtzLEMAGNIFIQUE", |  | ||||||
|   firstName:"Jhon", |  | ||||||
|   address: "Radiator Springs", |  | ||||||
|   country: "USA", |  | ||||||
|   birthdate:"2004-02-02", |  | ||||||
|   email:"JohnDoe@gmail.com", |  | ||||||
|   cursus:"IT", |  | ||||||
|   degree:"BAC1", |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|   id:1, |  | ||||||
|   type:"ReInscription", |  | ||||||
|   lastName:"Doe", |  | ||||||
|   firstName:"Jane", |  | ||||||
|   address: "Radiator Springs", |  | ||||||
|   country: "USA", |  | ||||||
|   birthdate:"2004-03-03", |  | ||||||
|   email:"JaneDoe@gmail.com", |  | ||||||
|   cursus:"Psychology", |  | ||||||
|   degree:"BAC1", |  | ||||||
| }] |  | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
|   <Req v-for="item of requests_example" v-bind="item"> |   <Req v-for="item of requests_example"/> | ||||||
|       </Req> |  | ||||||
| </template> | </template> | ||||||
|  | |||||||
| @ -3,28 +3,34 @@ | |||||||
|  * |  * | ||||||
|  * 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 } from './restConsumer.js' | import { restGet, restPost } 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 | ||||||
|  * TODO: add info in the Object (I don't know what will be needed) |  * TODO: add info in the Object (I don't know what will be needed) | ||||||
|  */ |  */ | ||||||
| export async function createRegister(){ | export async function createRegister(){ | ||||||
| 	return restPost("/requests/register"}); | 	return restPost("/requests/register"); | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * list all register request in a list of Objects |  * list all register request in a list of Objects | ||||||
|  */ |  * Shall return a list of | ||||||
| export async function getRegisters(){ |  * - id | ||||||
| 	return restGet("/requests/register") |  * - type | ||||||
| } |  * - lastName | ||||||
|  |  * - firstName | ||||||
| /** |  * - address | ||||||
|  * Get info on a particular registering request |  * - country | ||||||
|  |  * - birthdate | ||||||
|  |  * - email | ||||||
|  |  * - cursus | ||||||
|  |  * - degree | ||||||
|  */ |  */ | ||||||
| export async function getRegisters(id){ | export async function getRegisters(id){ | ||||||
| 	return restGet("/requests/register/" + id); | 	if(id != null) | ||||||
|  | 		return restGet("/requests/register/" + id); | ||||||
|  | 	return restGet("/requests/register") | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user