fix(route/reuters): Using `by topic` fetching method for `tags`, (#15285)

This commit is contained in:
Andvari 2024-04-18 23:03:15 +08:00 committed by GitHub
parent 9ef453e501
commit 166e1fd753
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -64,13 +64,13 @@ export const route: Route = {
};
async function handler(ctx) {
const MUST_FETCH_BY_TOPICS = new Set(['authors']);
const MUST_FETCH_BY_TOPICS = new Set(['authors', 'tags']);
const CAN_USE_SOPHI = ['world'];
const category = ctx.req.param('category');
const topic = ctx.req.param('topic') ?? (category === 'authors' ? 'reuters' : '');
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20;
const useSophi = ctx.req.query('sophi') === 'true' && 'topic' !== '' && CAN_USE_SOPHI.includes(category);
const useSophi = ctx.req.query('sophi') === 'true' && topic !== '' && CAN_USE_SOPHI.includes(category);
const section_id = `/${category}/${topic ? `${topic}/` : ''}`;
const { title, description, rootUrl, response } = await (async () => {