mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(admin)!: move the admin api to rest and fix its defects (#2515)
This commit is contained in:
1 parent
a70924d4b0
commit
7f8f09ee51
143 files changed
+15238
-12790
No files matched your search
@@ -10,6 +10,7 @@ import {CannotReportOwnMessageError} from '@fluxer/errors/src/domains/channel/Ca
|
||||
import {UnknownChannelError} from '@fluxer/errors/src/domains/channel/UnknownChannelError';
|
||||
import {UnknownMessageError} from '@fluxer/errors/src/domains/channel/UnknownMessageError';
|
||||
import {ConflictError} from '@fluxer/errors/src/domains/core/ConflictError';
|
||||
import {FeatureTemporarilyDisabledError} from '@fluxer/errors/src/domains/core/FeatureTemporarilyDisabledError';
|
||||
import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidationError';
|
||||
import {RateLimitError} from '@fluxer/errors/src/domains/core/RateLimitError';
|
||||
import {CannotReportGuildError} from '@fluxer/errors/src/domains/guild/CannotReportGuildError';
|
||||
@@ -804,7 +805,7 @@ export class ReportService {
|
||||
|
||||
async listMyReports(reporterId: UserID, limit?: number, offset?: number): Promise<Array<IARSubmission>> {
|
||||
if (!this.reportSearchService) {
|
||||
throw new Error('Search service not available');
|
||||
throw new FeatureTemporarilyDisabledError();
|
||||
}
|
||||
const {hits} = await this.reportSearchService.listReportsByReporter(reporterId, limit, offset);
|
||||
const reportIds = hits.map((hit) => createReportID(BigInt(hit.id)));
|
||||
@@ -814,7 +815,7 @@ export class ReportService {
|
||||
|
||||
async listReportsByStatus(status: number, limit?: number, offset?: number): Promise<Array<IARSubmission>> {
|
||||
if (!this.reportSearchService) {
|
||||
throw new Error('Search service not available');
|
||||
throw new FeatureTemporarilyDisabledError();
|
||||
}
|
||||
const {hits} = await this.reportSearchService.listReportsByStatus(status, limit, offset);
|
||||
const reportIds = hits.map((hit) => createReportID(BigInt(hit.id)));
|
||||
|
||||
@@ -229,9 +229,9 @@ describe('Content Reporting', () => {
|
||||
resolved_at: string | null;
|
||||
public_comment: string | null;
|
||||
}>(harness, `${admin.token}`)
|
||||
.post('/admin/reports/resolve')
|
||||
.patch(`/admin/reports/${report.report_id}`)
|
||||
.body({
|
||||
report_id: report.report_id,
|
||||
status: 'resolved',
|
||||
public_comment: publicComment,
|
||||
})
|
||||
.expect(HTTP_STATUS.OK)
|
||||
|
||||
Reference in new issue
Block a user