mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-28 21:48:06 +09:00
d2b5b67b44
将来ESMに移行しやすいように Related: #7658 なんかmochaが起動しなくなってるけど理由不明 すぐ直したい
29 lines
543 B
TypeScript
29 lines
543 B
TypeScript
import $ from 'cafy';
|
|
import define from '../../define.js';
|
|
import { deleteFile } from '@/services/drive/delete-file.js';
|
|
import { DriveFiles } from '@/models/index.js';
|
|
import { ID } from '@/misc/cafy-id.js';
|
|
|
|
export const meta = {
|
|
tags: ['admin'],
|
|
|
|
requireCredential: true as const,
|
|
requireModerator: true,
|
|
|
|
params: {
|
|
userId: {
|
|
validator: $.type(ID),
|
|
},
|
|
}
|
|
};
|
|
|
|
export default define(meta, async (ps, me) => {
|
|
const files = await DriveFiles.find({
|
|
userId: ps.userId
|
|
});
|
|
|
|
for (const file of files) {
|
|
deleteFile(file);
|
|
}
|
|
});
|