Files
Hengyu 952b0b7115 fix(route): fix the error of route hk01/channel when channel does not have publishName (#12152)
* Fix hk01/channel when channel does not have publishName

* additional fix to the same problem

* Add(route): hk01 latest

* Fix radar

* docs: fix category

---------
2023-04-04 00:21:44 +08:00

21 lines
530 B
JavaScript

const got = require('@/utils/got');
const { rootUrl, apiRootUrl, ProcessItems } = require('./utils');
module.exports = async (ctx) => {
const currentUrl = `${rootUrl}/latest`;
const apiUrl = `${apiRootUrl}/v2/page/latest`;
const response = await got({
method: 'get',
url: apiUrl,
});
const items = await ProcessItems(response.data.items, ctx.query.limit, ctx.cache.tryGet);
ctx.state.data = {
title: '即時 | 香港01',
link: currentUrl,
item: items,
};
};