From 0491042d9586a4dce177f558795eafdade935bac Mon Sep 17 00:00:00 2001 From: atsu1125 Date: Tue, 3 Jan 2023 23:36:33 +0900 Subject: [PATCH] Feat: Revoke Invitation Codes --- locales/en-US.yml | 2 ++ locales/ja-JP.yml | 2 ++ .../api/endpoints/admin/invite-revoke.ts | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 src/server/api/endpoints/admin/invite-revoke.ts diff --git a/locales/en-US.yml b/locales/en-US.yml index dce63d3bb2..87fd214229 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1115,6 +1115,8 @@ thisFlashRequiresTheFollowingPermissions: "This Play requires the following perm doYouWantToAllowThisPlayToAccessYourAccount: "Do you want to allow this Play to access your account?" translateProfile: "Translate profile" enableAbsoluteTime: "Enable Absolute Time" +inviteRevoke: "Revoke All Invitation Codes" +inviteRevokeConfirm: "Are you sure that you want to revoke all invitation codes?" _group: leader: "Group owner" banish: "Banish" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index db909e0ea5..519c20de0b 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1115,6 +1115,8 @@ thisFlashRequiresTheFollowingPermissions: "このPlayは以下の権限を要求 doYouWantToAllowThisPlayToAccessYourAccount: "このPlayによるアカウントへのアクセスを許可しますか?" translateProfile: "プロフィールを翻訳する" enableAbsoluteTime: "絶対時刻表記を使用する" +inviteRevoke: "全ての招待コードを失効する" +inviteRevokeConfirm: "本当に全ての招待コードを失効させますか?" _group: leader: "グループオーナー" diff --git a/src/server/api/endpoints/admin/invite-revoke.ts b/src/server/api/endpoints/admin/invite-revoke.ts new file mode 100644 index 0000000000..abca4ce03e --- /dev/null +++ b/src/server/api/endpoints/admin/invite-revoke.ts @@ -0,0 +1,20 @@ +import define from '../../define'; +import { RegistrationTickets } from '../../../../models'; + +export const meta = { + desc: { + 'ja-JP': '招待コードを失効します。' + }, + + tags: ['admin'], + + requireCredential: true as const, + requireModerator: true, + + params: {} +}; + +export default define(meta, async () => { + await RegistrationTickets.delete({ + }); +});