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