2020-01-29 13:37:25 -06:00
|
|
|
import define from '../../define';
|
|
|
|
import { Antennas } from '../../../../models';
|
|
|
|
|
|
|
|
export const meta = {
|
2021-03-06 07:34:11 -06:00
|
|
|
desc: {
|
|
|
|
'ja-JP': 'アンテナの一覧を取得します。',
|
|
|
|
'en-US': 'Get a list of antennas.'
|
|
|
|
},
|
|
|
|
|
2020-01-29 13:37:25 -06:00
|
|
|
tags: ['antennas', 'account'],
|
|
|
|
|
2020-02-15 06:33:32 -06:00
|
|
|
requireCredential: true as const,
|
2020-01-29 13:37:25 -06:00
|
|
|
|
|
|
|
kind: 'read:account',
|
2021-03-06 07:34:11 -06:00
|
|
|
|
|
|
|
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: 'Antenna'
|
|
|
|
}
|
|
|
|
}
|
2020-01-29 13:37:25 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
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)));
|
|
|
|
});
|