From d21ec6d241a2b5ba8c1d593114a8f2f4f3d9dee3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 29 Aug 2023 13:04:38 -0500 Subject: [PATCH] apps: use AppController type --- src/controllers/api/apps.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/api/apps.ts b/src/controllers/api/apps.ts index c3ebee3..4f60a19 100644 --- a/src/controllers/api/apps.ts +++ b/src/controllers/api/apps.ts @@ -1,4 +1,4 @@ -import type { Context } from '@/deps.ts'; +import type { AppController } from '@/app.ts'; /** * Apps are unnecessary cruft in Mastodon API, but necessary to make clients work. @@ -14,7 +14,7 @@ const FAKE_APP = { vapid_key: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=', }; -async function createAppController(c: Context) { +const createAppController: AppController = async (c) => { // TODO: Handle both formData and json. 422 on parsing error. try { const { redirect_uris } = await c.req.json(); @@ -26,10 +26,10 @@ async function createAppController(c: Context) { } catch (_e) { return c.json(FAKE_APP); } -} +}; -function appCredentialsController(c: Context) { +const appCredentialsController: AppController = (c) => { return c.json(FAKE_APP); -} +}; export { appCredentialsController, createAppController };