Paginate reports

This commit is contained in:
Alex Gleason 2024-06-09 11:07:37 -05:00
parent 8a7cae9841
commit 58a01f90de
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import { z } from 'zod';
import { type AppController } from '@/app.ts'; import { type AppController } from '@/app.ts';
import { Conf } from '@/config.ts'; import { Conf } from '@/config.ts';
import { createEvent, paginationSchema, parseBody, updateEventInfo } from '@/utils/api.ts'; import { createEvent, paginated, paginationSchema, parseBody, updateEventInfo } from '@/utils/api.ts';
import { hydrateEvents } from '@/storages/hydrate.ts'; import { hydrateEvents } from '@/storages/hydrate.ts';
import { renderAdminReport } from '@/views/mastodon/reports.ts'; import { renderAdminReport } from '@/views/mastodon/reports.ts';
import { renderReport } from '@/views/mastodon/reports.ts'; import { renderReport } from '@/views/mastodon/reports.ts';
@ -101,7 +101,7 @@ const adminReportsController: AppController = async (c) => {
events.map((event) => renderAdminReport(event, { viewerPubkey })), events.map((event) => renderAdminReport(event, { viewerPubkey })),
); );
return c.json(reports); return paginated(c, orig, reports);
}; };
/** https://docs.joinmastodon.org/methods/admin/reports/#get-one */ /** https://docs.joinmastodon.org/methods/admin/reports/#get-one */