added patch coAuthors
This commit is contained in:
		| @ -8,10 +8,8 @@ | ||||
|  | ||||
| import { ref } from "vue"; | ||||
| import {onClickOutside} from '@vueuse/core' | ||||
| import {uploadFile, postResearch, fetchAllResearchers} from "@/rest/ScientificPublications/ManageResearch.js"; | ||||
| import {uploadFile, postResearch} from "@/rest/ScientificPublications/ManageResearch.js"; | ||||
| import i18n from "../../i18n.js"; | ||||
| const allResearcher = ref(await fetchAllResearchers()) | ||||
|  | ||||
| const coAuthors = ref([]) | ||||
|  | ||||
| let toPost = Object.assign({}, {coAuthors:[]}); | ||||
| @ -19,7 +17,8 @@ let toPost = Object.assign({}, {coAuthors:[]}); | ||||
|  | ||||
| const props = defineProps({ | ||||
|   isOpen: Boolean, | ||||
|   researcher: ref(Object) | ||||
|   researcher: ref(Object), | ||||
|   allResearcher:ref() | ||||
| }); | ||||
|  | ||||
|  | ||||
| @ -37,7 +36,6 @@ async function postNewResearch(){ | ||||
|   toPost.releaseDate = new Date() | ||||
|   toPost.author = props.researcher | ||||
|   toPost.coAuthors = coAuthors.value | ||||
|   console.log() | ||||
|   //the Pdf and a title are required | ||||
|   if (toPost.pdfLocation == null || toPost.title == null || toPost.title === "") { | ||||
|     emit("modal-close") | ||||
| @ -96,7 +94,7 @@ onClickOutside(target, ()=>emit('modal-close')) | ||||
|         </ul> | ||||
|         </div> | ||||
|         <div id="CoAuthorList"> {{i18n("CoAuthors.List")}} : | ||||
|         <ul style="list-style-type: none;" v-for="n in allResearcher"> | ||||
|         <ul style="list-style-type: none;" v-for="n in props.allResearcher"> | ||||
|           <li v-if="n.id !== props.researcher.id"> <input type="checkbox" :value=n v-model="coAuthors"> {{n.id}} : {{n.user.firstName}} {{n.user.lastName}}</li> | ||||
|         </ul> | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user