import define from '../../../define';
import { deleteFile } from '@/services/drive/delete-file';
import { DriveFiles } from '@/models/index';
export const meta = {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
} as const;
const paramDef = {
type: 'object',
properties: {
host: { type: 'string' },
},
required: ['host'],
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async (ps, me) => {
const files = await DriveFiles.find({
userHost: ps.host,
});
for (const file of files) {
deleteFile(file);
}