mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Rename timeline controllers, homeController --> homeTimelineController, etc
This commit is contained in:
parent
b6da5a0339
commit
ce4a330812
2 changed files with 10 additions and 6 deletions
10
src/app.ts
10
src/app.ts
|
|
@ -38,7 +38,11 @@ import {
|
||||||
statusController,
|
statusController,
|
||||||
} from './controllers/api/statuses.ts';
|
} from './controllers/api/statuses.ts';
|
||||||
import { streamingController } from './controllers/api/streaming.ts';
|
import { streamingController } from './controllers/api/streaming.ts';
|
||||||
import { hashtagTimelineController, homeController, publicController } from './controllers/api/timelines.ts';
|
import {
|
||||||
|
hashtagTimelineController,
|
||||||
|
homeTimelineController,
|
||||||
|
publicTimelineController,
|
||||||
|
} from './controllers/api/timelines.ts';
|
||||||
import { trendingTagsController } from './controllers/api/trends.ts';
|
import { trendingTagsController } from './controllers/api/trends.ts';
|
||||||
import { indexController } from './controllers/site.ts';
|
import { indexController } from './controllers/site.ts';
|
||||||
import { hostMetaController } from './controllers/well-known/host-meta.ts';
|
import { hostMetaController } from './controllers/well-known/host-meta.ts';
|
||||||
|
|
@ -107,8 +111,8 @@ app.get('/api/v1/statuses/:id{[0-9a-f]{64}}', statusController);
|
||||||
app.post('/api/v1/statuses/:id{[0-9a-f]{64}}/favourite', favouriteController);
|
app.post('/api/v1/statuses/:id{[0-9a-f]{64}}/favourite', favouriteController);
|
||||||
app.post('/api/v1/statuses', requirePubkey, createStatusController);
|
app.post('/api/v1/statuses', requirePubkey, createStatusController);
|
||||||
|
|
||||||
app.get('/api/v1/timelines/home', requirePubkey, homeController);
|
app.get('/api/v1/timelines/home', requirePubkey, homeTimelineController);
|
||||||
app.get('/api/v1/timelines/public', publicController);
|
app.get('/api/v1/timelines/public', publicTimelineController);
|
||||||
app.get('/api/v1/timelines/tag/:hashtag', hashtagTimelineController);
|
app.get('/api/v1/timelines/tag/:hashtag', hashtagTimelineController);
|
||||||
|
|
||||||
app.get('/api/v1/preferences', preferencesController);
|
app.get('/api/v1/preferences', preferencesController);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { Time } from '@/utils.ts';
|
||||||
|
|
||||||
import type { AppController } from '@/app.ts';
|
import type { AppController } from '@/app.ts';
|
||||||
|
|
||||||
const homeController: AppController = async (c) => {
|
const homeTimelineController: AppController = async (c) => {
|
||||||
const params = paginationSchema.parse(c.req.query());
|
const params = paginationSchema.parse(c.req.query());
|
||||||
const pubkey = c.get('pubkey')!;
|
const pubkey = c.get('pubkey')!;
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ const publicQuerySchema = z.object({
|
||||||
local: booleanParamSchema.catch(false),
|
local: booleanParamSchema.catch(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
const publicController: AppController = async (c) => {
|
const publicTimelineController: AppController = async (c) => {
|
||||||
const params = paginationSchema.parse(c.req.query());
|
const params = paginationSchema.parse(c.req.query());
|
||||||
const { local } = publicQuerySchema.parse(c.req.query());
|
const { local } = publicQuerySchema.parse(c.req.query());
|
||||||
|
|
||||||
|
|
@ -61,4 +61,4 @@ const hashtagTimelineController: AppController = async (c) => {
|
||||||
return c.json(statuses, 200, link ? { link } : undefined);
|
return c.json(statuses, 200, link ? { link } : undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { hashtagTimelineController, homeController, publicController };
|
export { hashtagTimelineController, homeTimelineController, publicTimelineController };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue