Add boilerplate notifications controller, fix import order in app.ts

This commit is contained in:
Alex Gleason 2023-08-28 14:23:27 -05:00
parent 6d5add92a2
commit dfbad6b2e7
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 17 additions and 9 deletions

View File

@ -24,11 +24,12 @@ import {
} from './controllers/api/accounts.ts';
import { appCredentialsController, createAppController } from './controllers/api/apps.ts';
import { emptyArrayController, emptyObjectController } from './controllers/api/fallback.ts';
import { homeController, publicController } from './controllers/api/timelines.ts';
import instanceController from './controllers/api/instance.ts';
import { instanceController } from './controllers/api/instance.ts';
import { notificationsController } from './controllers/api/notifications.ts';
import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts';
import { frontendConfigController } from './controllers/api/pleroma.ts';
import { preferencesController } from './controllers/api/preferences.ts';
import { relayController } from './controllers/nostr/relay.ts';
import { searchController } from './controllers/api/search.ts';
import {
contextController,
@ -37,8 +38,8 @@ import {
statusController,
} from './controllers/api/statuses.ts';
import { streamingController } from './controllers/api/streaming.ts';
import { homeController, publicController } from './controllers/api/timelines.ts';
import { trendingTagsController } from './controllers/api/trends.ts';
import { relayController } from './controllers/nostr/relay.ts';
import { indexController } from './controllers/site.ts';
import { hostMetaController } from './controllers/well-known/host-meta.ts';
import { nodeInfoController, nodeInfoSchemaController } from './controllers/well-known/nodeinfo.ts';
@ -118,8 +119,9 @@ app.get('/api/pleroma/frontend_configurations', frontendConfigController);
app.get('/api/v1/trends/tags', trendingTagsController);
app.get('/api/v1/trends', trendingTagsController);
app.get('/api/v1/notifications', notificationsController);
// Not (yet) implemented.
app.get('/api/v1/notifications', emptyArrayController);
app.get('/api/v1/bookmarks', emptyArrayController);
app.get('/api/v1/custom_emojis', emptyArrayController);
app.get('/api/v1/accounts/search', emptyArrayController);

View File

@ -1,8 +1,7 @@
import { type AppController } from '@/app.ts';
import { Conf } from '@/config.ts';
import type { Context } from '@/deps.ts';
function instanceController(c: Context) {
const instanceController: AppController = (c) => {
const { host, protocol } = Conf.url;
/** Protocol to use for WebSocket URLs, depending on the protocol of the `LOCAL_DOMAIN`. */
@ -48,6 +47,6 @@ function instanceController(c: Context) {
},
rules: [],
});
}
};
export default instanceController;
export { instanceController };

View File

@ -0,0 +1,7 @@
import { type AppController } from '@/app.ts';
const notificationsController: AppController = (c) => {
return c.json([]);
};
export { notificationsController };