diff --git a/src/client/app/admin/views/logs.vue b/src/client/app/admin/views/logs.vue index 5c2cfdb396..cb54318187 100644 --- a/src/client/app/admin/views/logs.vue +++ b/src/client/app/admin/views/logs.vue @@ -26,6 +26,8 @@ + + {{ $t('delete-all') }} @@ -78,6 +80,15 @@ export default Vue.extend({ }).then(logs => { this.logs = logs.reverse(); }); + }, + + deleteAll() { + this.$root.api('admin/delete-logs').then(() => { + this.$root.dialog({ + type: 'success', + splash: true + }); + }); } } }); diff --git a/src/server/api/endpoints/admin/delete-logs.ts b/src/server/api/endpoints/admin/delete-logs.ts new file mode 100644 index 0000000000..26cf13c1f6 --- /dev/null +++ b/src/server/api/endpoints/admin/delete-logs.ts @@ -0,0 +1,13 @@ +import define from '../../define'; +import { Logs } from '../../../../models'; + +export const meta = { + tags: ['admin'], + + requireCredential: true, + requireModerator: true, +}; + +export default define(meta, async (ps) => { + await Logs.delete({}); +});