Small changes

This commit is contained in:
2024-04-20 12:42:41 +02:00
parent 92cdeaebba
commit cdc3772384
6 changed files with 22 additions and 8 deletions

View File

@ -3,6 +3,7 @@
import {reactive, ref} from "vue";
import {getSelf} from "@/rest/Users.js";
import {createExternalCurriculum, getExternalCurriculumByUser} from "@/rest/externalCurriculum.js";
import {uploadFile} from "@/rest/uploads.js";
//mode 0 = externalcurr related to inscrreq, 1 = externalcurr related to user, 2 inscription procedure
const props = defineProps(["extCurrList", "mode"])
@ -51,7 +52,8 @@
async function postExternalCurr(){
if (props.mode === 1){
await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, externalCurr.justifdocUrl, externalCurr.userRegNo);
const temp = await uploadFile(externalCurr.justifdocUrl, "JustificationDocument")
await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, temp.value.url, externalCurr.userRegNo);
//We refresh the list
extCurrList.value = await getExternalCurriculumByUser(externalCurr.userRegNo);
list.value = !list.value;
@ -68,7 +70,6 @@
});
extCurrList.value = externalCurrTab.value
list.value = !list.value;
console.log(externalCurrTab.value)
}
}
</script>
@ -118,6 +119,10 @@
<p>Année de fin</p>
<input type="number" v-model="externalCurr.endYear">
</div>
<div class="inputBox">
<p>Veuillez soumettre un document attestant de ce parcours</p>
<input type="file" @change="externalCurr.justifdocUrl = $event.target.files">
</div>
<div class="inputBox" style="margin-top: 3%; margin-bottom: 3%">
<input v-if="!editmode" type="submit" value="Upload curriculum" @click="postExternalCurr()">
<input v-else type="submit" value="Edit curriculum" @click="externalCurrTab[extNum] = {inscriptionRequestId : externalCurr.inscriptionRequestId,school:externalCurr.school,formation :externalCurr.formation,completion : externalCurr.completion,startYear : externalCurr.startYear,endYear: externalCurr.endYear,justifdocUrl : externalCurr.justifdocUrl,userRegNo : externalCurr.userRegNo};editmode=!editmode;list=!list">