Fix and simplifie the post and get for externalCurriculum
This commit is contained in:
		@ -1,14 +1,16 @@
 | 
			
		||||
<script setup>
 | 
			
		||||
import i18n from "@/i18n.js"
 | 
			
		||||
import {getUser} from '../rest/Users.js'
 | 
			
		||||
import {getcurriculum, getExternalCurriculumListByInscrReq, getSomeonesCurriculumList} from "@/rest/curriculum.js";
 | 
			
		||||
import {getcurriculum,getSomeonesCurriculumList} from "@/rest/curriculum.js";
 | 
			
		||||
import {getRegisters} from "@/rest/ServiceInscription.js";
 | 
			
		||||
import {get} from "jsdom/lib/jsdom/named-properties-tracker.js";
 | 
			
		||||
import {getExternalCurriculumByInscrReq} from "@/rest/externalCurriculum.js";
 | 
			
		||||
 | 
			
		||||
const props = defineProps(['target']);
 | 
			
		||||
let request = await getRegisters(props.target);
 | 
			
		||||
const cursus = await getcurriculum(request.curriculum);
 | 
			
		||||
const externalCurriculum = await getExternalCurriculumListByInscrReq(request.id)
 | 
			
		||||
 | 
			
		||||
const externalCurriculum = await getExternalCurriculumByInscrReq(request.id)
 | 
			
		||||
console.log(externalCurriculum)
 | 
			
		||||
function getPP(){
 | 
			
		||||
  if(request.profilePictureUrl === null){
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,5 @@
 | 
			
		||||
import {restGet, 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){
 | 
			
		||||
    return restPost("/externalcurriculum", {
 | 
			
		||||
@ -6,12 +7,12 @@ export async function createExternalCurriculum(inscriptionRequestId,school, form
 | 
			
		||||
        school:school,
 | 
			
		||||
        formation :formation,
 | 
			
		||||
        completion : completion,
 | 
			
		||||
        startYear : startYear,
 | 
			
		||||
        endYear: endYear,
 | 
			
		||||
        startYear : parseInteger(startYear),
 | 
			
		||||
        endYear: parseInteger(endYear),
 | 
			
		||||
        justifdocUrl : justifdocUrl
 | 
			
		||||
    })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function getExternalCurriculumListByInscrReq(inscriptionRequestId){
 | 
			
		||||
    return restGet("/externalCurriculum/"+parseInt(inscriptionRequestId))
 | 
			
		||||
}
 | 
			
		||||
export async function getExternalCurriculumByInscrReq(inscrReqId){
 | 
			
		||||
    return restGet("/externalcurriculum/"+inscrReqId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user