iceshrimp-legacy/src/server/api/endpoints/admin/drive/cleanup.ts
syuilo b9cb6d1c10 refactor: refactoring imports
将来ESMに移行しやすいように
Related: #7658

なんかmochaが起動しなくなってるけど理由不明
すぐ直したい
2021-08-19 18:33:41 +09:00

22 lines
459 B
TypeScript

import { IsNull } from 'typeorm';
import define from '../../../define.js';
import { deleteFile } from '@/services/drive/delete-file.js';
import { DriveFiles } from '@/models/index.js';
export const meta = {
tags: ['admin'],
requireCredential: true as const,
requireModerator: true,
};
export default define(meta, async (ps, me) => {
const files = await DriveFiles.find({
userId: IsNull()
});
for (const file of files) {
deleteFile(file);
}
});