From c29dedaad7477af7bf7c55d7216049cb5b74bc86 Mon Sep 17 00:00:00 2001
From: carlossa <carlossa@verdnatura.es>
Date: Mon, 28 Oct 2024 11:52:39 +0100
Subject: [PATCH] fix: refs #4774 front remove

---
 src/pages/Worker/TranslationsVn.vue | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/pages/Worker/TranslationsVn.vue b/src/pages/Worker/TranslationsVn.vue
index e29b503d8..f36407a9d 100644
--- a/src/pages/Worker/TranslationsVn.vue
+++ b/src/pages/Worker/TranslationsVn.vue
@@ -11,6 +11,12 @@ import VnInput from 'src/components/common/VnInput.vue';
 
 const { t } = useI18n();
 const columns = computed(() => [
+    {
+        align: 'left',
+        name: 'id',
+        label: t('id'),
+        visible: false,
+    },
     {
         align: 'left',
         name: primaryKey,
@@ -39,6 +45,19 @@ const columns = computed(() => [
                 isPrimary: true,
                 disable: (row) => !row.hasChanges,
             },
+            {
+                title: t('globals.delete'),
+                icon: 'delete',
+                isPrimary: true,
+                action: (row) =>
+                    openConfirmationModal(
+                        t('You are going to delete this ticket purchase request'),
+                        t(
+                            'This ticket will be removed from ticket purchase requests! Continue anyway?'
+                        ),
+                        () => removeLine(row.id)
+                    ),
+            },
         ],
     },
 ]);
@@ -97,6 +116,16 @@ async function upsertI18n(data) {
     originalData.value[index] = data;
     data.hasChanges = false;
 }
+
+// async function removeLine(id) {
+//     try {
+//         await axios.delete(`TicketRequests/${id}`);
+//         notify(t('globals.dataSaved'), 'positive');
+//         location.reload();
+//     } catch (err) {
+//         console.error('Error ', err);
+//     }
+// }
 </script>
 
 <template>