summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/settings/webhook.edit.vue
diff options
context:
space:
mode:
authorCaipira <caipira@ifacrylic.space>2023-02-05 20:31:38 +0900
committerGitHub <noreply@github.com>2023-02-05 20:31:38 +0900
commitc20ce12f862fdaedba8d6313a21281a6c6a4f48a (patch)
tree39ed4900bd3d2da84eb9d655cec49f596b49ac0b /packages/frontend/src/pages/settings/webhook.edit.vue
parentUpdate CHANGELOG.md (diff)
downloadmisskey-c20ce12f862fdaedba8d6313a21281a6c6a4f48a.tar.gz
misskey-c20ce12f862fdaedba8d6313a21281a6c6a4f48a.tar.bz2
misskey-c20ce12f862fdaedba8d6313a21281a6c6a4f48a.zip
enhance(client): add webhook delete button (#9806)
Diffstat (limited to 'packages/frontend/src/pages/settings/webhook.edit.vue')
-rw-r--r--packages/frontend/src/pages/settings/webhook.edit.vue17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/frontend/src/pages/settings/webhook.edit.vue b/packages/frontend/src/pages/settings/webhook.edit.vue
index 7a819eb9f0..a01e3f8cee 100644
--- a/packages/frontend/src/pages/settings/webhook.edit.vue
+++ b/packages/frontend/src/pages/settings/webhook.edit.vue
@@ -31,6 +31,7 @@
<div class="_buttons">
<MkButton primary inline @click="save"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton>
+ <MkButton danger inline @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
</div>
</div>
</template>
@@ -44,6 +45,9 @@ import MkButton from '@/components/MkButton.vue';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
+import { useRouter } from '@/router';
+
+const router = useRouter();
const props = defineProps<{
webhookId: string;
@@ -86,6 +90,19 @@ async function save(): Promise<void> {
});
}
+async function del(): Promise<void> {
+ const { canceled } = await os.confirm({
+ type: 'warning',
+ text: i18n.t('deleteAreYouSure', { x: webhook.name }),
+ });
+ if (canceled) return;
+
+ await os.apiWithDialog('i/webhooks/delete', {
+ webhookId: props.webhookId,
+ });
+
+ router.push('/settings/webhook');
+}
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);