mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Resolve #4967
This commit is contained in:
parent
7e5a4456c2
commit
09cc82bf39
@ -26,6 +26,8 @@
|
||||
</details>
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<ui-button @click="deleteAll()">{{ $t('delete-all') }}</ui-button>
|
||||
</section>
|
||||
</ui-card>
|
||||
</div>
|
||||
@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
13
src/server/api/endpoints/admin/delete-logs.ts
Normal file
13
src/server/api/endpoints/admin/delete-logs.ts
Normal file
@ -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({});
|
||||
});
|
Loading…
Reference in New Issue
Block a user