From e8088c9eedf01c9cc7cc8483ade320143c82fd57 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Wed, 1 May 2024 20:38:30 -0300 Subject: [PATCH] feat: define reports endpoint --- src/app.ts | 3 +++ src/controllers/api/reports.ts | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 src/controllers/api/reports.ts diff --git a/src/app.ts b/src/app.ts index 7e91a01..1f58063 100644 --- a/src/app.ts +++ b/src/app.ts @@ -77,6 +77,7 @@ import { cache } from '@/middleware/cache.ts'; import { csp } from '@/middleware/csp.ts'; import { adminRelaysController } from '@/controllers/api/ditto.ts'; import { storeMiddleware } from '@/middleware/store.ts'; +import { reportsController } from '@/controllers/api/reports.ts'; interface AppEnv extends HonoEnv { Variables: { @@ -192,6 +193,8 @@ app.delete('/api/v1/pleroma/admin/statuses/:id', requireRole('admin'), pleromaAd app.get('/api/v1/admin/ditto/relays', requireRole('admin'), adminRelaysController); app.put('/api/v1/admin/ditto/relays', requireRole('admin'), adminRelaysController); +app.post('/api/v1/reports', requirePubkey, reportsController); + // Not (yet) implemented. app.get('/api/v1/custom_emojis', emptyArrayController); app.get('/api/v1/filters', emptyArrayController); diff --git a/src/controllers/api/reports.ts b/src/controllers/api/reports.ts new file mode 100644 index 0000000..24d8f45 --- /dev/null +++ b/src/controllers/api/reports.ts @@ -0,0 +1,7 @@ +import { type AppController } from '@/app.ts'; + +const reportsController: AppController = (c) => { + return c.json('Reports endpoint'); +}; + +export { reportsController };