2021-08-19 11:33:41 +02:00
|
|
|
import define from '../../define.js';
|
|
|
|
import { Antennas } from '@/models/index.js';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
tags: ['antennas', 'account'],
|
|
|
|
|
2020-02-15 13:33:32 +01:00
|
|
|
requireCredential: true as const,
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
|
|
kind: 'read:account',
|
2021-03-06 14:34:11 +01: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 20:37:25 +01: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)));
|
|
|
|
});
|