mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-01-16 18:41:01 -07:00
30a9370d39
* wip * wip * wip * wip * Update ja-JP.yml * wip * wip * wip
29 lines
673 B
TypeScript
29 lines
673 B
TypeScript
import define from '../../define';
|
|
import { Pages } from '../../../../models';
|
|
|
|
export const meta = {
|
|
tags: ['pages'],
|
|
|
|
requireCredential: false as const,
|
|
|
|
res: {
|
|
type: 'array' as const,
|
|
optional: false as const, nullable: false as const,
|
|
items: {
|
|
type: 'object' as const,
|
|
optional: false as const, nullable: false as const,
|
|
ref: 'Page',
|
|
}
|
|
},
|
|
};
|
|
|
|
export default define(meta, async (ps, me) => {
|
|
const query = Pages.createQueryBuilder('page')
|
|
.where('page.visibility = \'public\'')
|
|
.andWhere('page.likedCount > 0')
|
|
.orderBy('page.likedCount', 'DESC');
|
|
|
|
const pages = await query.take(10).getMany();
|
|
|
|
return await Pages.packMany(pages, me);
|
|
});
|