mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-20 00:47:37 -07:00
4e15337a64
* wip * wip * wip * Update index.ts * Update gen-openapi-spec.ts * Update api.ja-JP.md * Fix * Improve doc * Update gen-openapi-spec.ts * Update redoc.html * Improve doc * Update gen-openapi-spec.ts * Improve doc * Update CHANGELOG.md
34 lines
616 B
TypeScript
34 lines
616 B
TypeScript
import $ from 'cafy';
|
|
import ID, { transform } from '../../../../misc/cafy-id';
|
|
import define from '../../define';
|
|
import AbuseUserReport from '../../../../models/abuse-user-report';
|
|
|
|
export const meta = {
|
|
tags: ['admin'],
|
|
|
|
requireCredential: true,
|
|
requireModerator: true,
|
|
|
|
params: {
|
|
reportId: {
|
|
validator: $.type(ID),
|
|
transform: transform
|
|
},
|
|
}
|
|
};
|
|
|
|
export default define(meta, async (ps) => {
|
|
const report = await AbuseUserReport.findOne({
|
|
_id: ps.reportId
|
|
});
|
|
|
|
if (report == null) {
|
|
throw new Error('report not found');
|
|
}
|
|
|
|
await AbuseUserReport.remove({
|
|
_id: report._id
|
|
});
|
|
|
|
return;
|
|
});
|