feat: refs #7119 implement async delete functionality for vehicle items
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2025-01-24 10:53:28 +01:00
parent 2e4610847d
commit d40b6fb06b
1 changed files with 15 additions and 1 deletions

View File

@ -1,11 +1,25 @@
<script setup>
import VnLv from 'src/components/ui/VnLv.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import axios from 'axios';
</script>
<template>
<CardDescriptor module="Vehicle" data-key="Vehicle" title="numberPlate">
<template #menu="{ entity }">
<QItem v-ripple clickable @click="axios.delete(`Vehicles/${entity.id}`)">
<QItem
v-ripple
clickable
@click="
async () => {
try {
await axios.delete(`Vehicles/${entity.id}`);
$router.push({ name: 'VehicleList' });
} catch (e) {
throw e;
}
}
"
>
<QItemSection>
{{ $t('vehicle.delete') }}
</QItemSection>