Mention names of deleted resources in confirm dialogs

This commit is contained in:
Johannes Zellner
2025-06-12 17:24:07 +02:00
parent 228532b03e
commit 733de44d03
4 changed files with 15 additions and 12 deletions
+4 -4
View File
@@ -92,9 +92,9 @@ function onReset() {
}, 500);
}
async function onRevokeToken(token) {
async function onRevokeToken(id, name) {
const yes = await inputDialog.value.confirm({
message: t('profile.removeApiToken.title'),
message: t('profile.removeApiToken.title', { name }),
modal: true,
confirmStyle: 'danger',
confirmLabel: t('main.dialog.yes'),
@@ -103,7 +103,7 @@ async function onRevokeToken(token) {
if (!yes) return;
const [error] = await tokensModel.remove(token.id);
const [error] = await tokensModel.remove(id);
if (error) return console.error(error);
await refreshApiTokens();
@@ -184,7 +184,7 @@ onMounted(async () => {
</template>
<template #actions="apiToken">
<div class="table-actions">
<Button small tool danger @click="onRevokeToken(apiToken)" v-tooltip="$t('profile.apiTokens.revokeTokenTooltip')" icon="far fa-trash-alt" />
<Button small tool danger @click="onRevokeToken(apiToken.id, apiToken.name)" v-tooltip="$t('profile.apiTokens.revokeTokenTooltip')" icon="far fa-trash-alt" />
</div>
</template>
</TableView>