fixed views update #188

Merged
Maxime merged 1 commits from Maxime/Clyde:master into master 2024-04-22 22:37:27 +02:00
2 changed files with 14 additions and 2 deletions

View File

@ -35,6 +35,14 @@ watch(
}
);
async function modified(){
if (typeof props.researchList === 'undefined'){
researchList.value = await fetchAllResearches()
}
else {
emit('modified')
}
}
const openFilter = () => {
isFilterOpened.value = true;
@ -112,7 +120,7 @@ const emit = defineEmits(["modified"]);
<template>
<div id="researches">
<FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters"></FilterComponent>
<ArticleComponent :allResearcher="allResearcher" :article="articleToDisplay" :isOpen="isResearchOpened" :manage="props.manage" @modal-close="closeResearch" @modified="emit('modified')"></ArticleComponent>
<ArticleComponent :allResearcher="allResearcher" :article="articleToDisplay" :isOpen="isResearchOpened" :manage="props.manage" @modal-close="closeResearch" @modified="modified"></ArticleComponent>
<div id="search">
<input v-if="!isResearcher" type="text" id="search-input" :placeholder="i18n('Search.Researches')" v-model="input"/>
<input v-else type="text" id="search-input" :placeholder="i18n('Search.Researchers')" v-model="input"/>

View File

@ -73,6 +73,10 @@ function update(){
}
}
async function modifiedResearch(){
researchList.value = await fetchResearches(researcher.value.id)
}
</script>
<template>
@ -111,7 +115,7 @@ function update(){
<CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/>
</div>
</div>
<div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList"></list-researches></div>
<div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList" @modified="modifiedResearch"></list-researches></div>
</div>
</template>