Sharkey/src/server/api/endpoints/antennas/list.ts
syuilo f6154dc0af
v12 (#5712)
Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com>
Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
2020-01-30 04:37:25 +09:00

18 lines
371 B
TypeScript

import define from '../../define';
import { Antennas } from '../../../../models';
export const meta = {
tags: ['antennas', 'account'],
requireCredential: true,
kind: 'read:account',
};
export default define(meta, async (ps, me) => {
const antennas = await Antennas.find({
userId: me.id,
});
return await Promise.all(antennas.map(x => Antennas.pack(x)));
});