Mention names of deleted resources in confirm dialogs
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user