2756f553c6
* wip
* wip
* wip
* Update attached_notes.ts
* wip
* Refactor
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update call.ts
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* ✌️
* Fix
32 lines
597 B
TypeScript
32 lines
597 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 = {
|
|
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;
|
|
});
|