chore(abuse-report): 不要になった処理を削除

This commit is contained in:
まっちゃとーにゅ
2024-01-07 13:33:33 +09:00
parent 078cfbcd19
commit fefcf8645f
2 changed files with 1 additions and 51 deletions

View File

@@ -63,14 +63,6 @@ export const paramDef = {
'violationRights',
'violationRightsOther',
'other',
// for compatibility
'personalinfoleak',
'selfharm',
'criticalbreach',
'otherbreach',
'violationrights',
'violationrightsother',
'notlike',
],
},
},
@@ -103,20 +95,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.cannotReportAdmin);
}
// for compatibility
if (ps.category === 'notlike') {
return;
}
const categoriesMap: Record<string, typeof paramDef['properties']['category']['enum'][number]> = {
'personalinfoleak': 'personalInfoLeak',
'selfharm': 'selfHarm',
'criticalbreach': 'criticalBreach',
'otherbreach': 'otherBreach',
'violationrights': 'violationRights',
'violationrightsother': 'violationRightsOther',
};
const report = await this.abuseUserReportsRepository.insert({
id: this.idService.gen(),
targetUserId: user.id,
@@ -124,7 +102,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
reporterId: me.id,
reporterHost: null,
comment: ps.comment,
category: typeof categoriesMap[ps.category] === 'string' ? categoriesMap[ps.category] : ps.category,
category: ps.category,
}).then(x => this.abuseUserReportsRepository.findOneByOrFail(x.identifiers[0]));
this.queueService.createReportAbuseJob(report);