diff --git a/components/DaughterTable.vue b/components/DaughterTable.vue index 17e31b1..241d91d 100644 --- a/components/DaughterTable.vue +++ b/components/DaughterTable.vue @@ -26,18 +26,21 @@ const headers = ref([ { title: t('nameMeta'), sortable:true, key: 'nameMeta' }, { title: t('area'), sortable:true, key: 'area' }, { title: t('expectedArea'), sortable:true, key: 'expectedArea' }, - { title: t('delete'), key: 'del' }, ]); // -- group by daughter solution -const groupBy = ref([{ title: t('nameFile'), sortable:true, key: 'nameFile' }]); +const groupBy = ref([{ sortable:true, key: 'idFile' }]); /** * Delete a daughter file * @param nameFile name of the daughter file to delete */ -function delDaughterFile(nameFile: string) { - model.value = model.value.filter((item) => item.nameFile !== nameFile); +function delDaughterFile(idFile: string) { + model.value = model.value.filter((item) => item.idFile !== idFile); + $fetch('/api/delFile', { + method: 'POST', + body: [idFile], + }); } @@ -60,7 +63,8 @@ function delDaughterFile(nameFile: string) { variant="text" @click="toggleGroup(item)" /> - {{ item.value }} + + {{ item.items[0].raw.nameFile }} mdi-delete diff --git a/components/ManageSerie.async.vue b/components/ManageSerie.async.vue index 8470104..72ba23d 100644 --- a/components/ManageSerie.async.vue +++ b/components/ManageSerie.async.vue @@ -72,7 +72,7 @@ async function sendFile() { // Update table of metabolites of the serie rDaughterTable.value.push( ...result[1].map((r: [string, number]) => ({ - id: result[0], + idFile: result[0], nameFile: daughterFile.value.name, nameMeta: r[0], area: r[1],