mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-02 16:26:44 -06:00
9855405b89
* wip * wip * wip * wip * wip * wip * wip * wip * wop * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * add notes * wip * wip * wip * wip * sound * wip * add kick_gaba2 * wip
28 lines
690 B
TypeScript
28 lines
690 B
TypeScript
import define from '../../define';
|
|
import { Channels } from '../../../../models';
|
|
|
|
export const meta = {
|
|
tags: ['channels'],
|
|
|
|
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: 'Channel',
|
|
}
|
|
},
|
|
};
|
|
|
|
export default define(meta, async (ps, me) => {
|
|
const query = Channels.createQueryBuilder('channel')
|
|
.where('channel.lastNotedAt IS NOT NULL')
|
|
.orderBy('channel.lastNotedAt', 'DESC');
|
|
|
|
const channels = await query.take(10).getMany();
|
|
|
|
return await Promise.all(channels.map(x => Channels.pack(x, me)));
|
|
});
|