forked from mirror/misskey
antenna
This commit is contained in:
parent
df10aa40f4
commit
3bf7e4bf02
@ -1,15 +1,13 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { Antenna } from '@/models/entities/antenna';
|
||||
import { SchemaType } from '@/misc/schema';
|
||||
import { Packed } from '@/misc/schema';
|
||||
import { AntennaNotes, UserGroupJoinings } from '../index';
|
||||
|
||||
export type PackedAntenna = SchemaType<typeof packedAntennaSchema>;
|
||||
|
||||
@EntityRepository(Antenna)
|
||||
export class AntennaRepository extends Repository<Antenna> {
|
||||
public async pack(
|
||||
src: Antenna['id'] | Antenna,
|
||||
): Promise<PackedAntenna> {
|
||||
): Promise<Packed<'Antenna'>> {
|
||||
const antenna = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
|
||||
const hasUnreadNote = (await AntennaNotes.findOne({ antennaId: antenna.id, read: false })) != null;
|
||||
|
Loading…
Reference in New Issue
Block a user