mirror of
https://github.com/misskey-dev/misskey
synced 2024-12-27 04:59:10 +09:00
29 lines
595 B
TypeScript
29 lines
595 B
TypeScript
|
import define from '../../define';
|
||
|
import { Channels } from '../../../../models';
|
||
|
|
||
|
export const meta = {
|
||
|
tags: ['channels', 'account'],
|
||
|
|
||
|
requireCredential: true as const,
|
||
|
|
||
|
kind: 'read:channels',
|
||
|
|
||
|
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 channels = await Channels.find({
|
||
|
userId: me.id,
|
||
|
});
|
||
|
|
||
|
return await Promise.all(channels.map(x => Channels.pack(x, me)));
|
||
|
});
|