1
0
forked from PGL/Clyde

added reactivity to post delete and patch

This commit is contained in:
2024-04-18 16:17:16 +02:00
parent 939b4f5492
commit 7394a23b45
3 changed files with 20 additions and 16 deletions

View File

@ -23,25 +23,25 @@ async function uploadResearchBibTexPdf(pdf){
// Date when sent!!
function postNewResearch(){
async function postNewResearch(){
toPost.releaseDate = new Date()
toPost.author = props.researcher
//the Pdf is required and a title
console.log(!toPost.pdfLocation == null|| toPost.title == null || toPost.title === "")
//the Pdf and a title are required
if (toPost.pdfLocation == null || toPost.title == null || toPost.title === "") {
emit("modal-close")
return;
}
postResearch(toPost)
await postResearch(toPost)
toPost = Object.assign({}, {});
emit("modal-close")
emit("posted")
}
function cancelPost(){
emit("modal-close")
toPost = Object.assign({}, {});
}
const emit = defineEmits(["modal-close"]);
const emit = defineEmits(["modal-close","posted"]);
const target = ref(null)
onClickOutside(target, ()=>emit('modal-close'))