mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 08:10:24 +01:00
channel
This commit is contained in:
parent
5ed72999a9
commit
df10aa40f4
1 changed files with 2 additions and 4 deletions
|
@ -1,17 +1,15 @@
|
|||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { Channel } from '@/models/entities/channel';
|
||||
import { SchemaType } from '@/misc/schema';
|
||||
import { Packed } from '@/misc/schema';
|
||||
import { DriveFiles, ChannelFollowings, NoteUnreads } from '../index';
|
||||
import { User } from '@/models/entities/user';
|
||||
|
||||
export type PackedChannel = SchemaType<typeof packedChannelSchema>;
|
||||
|
||||
@EntityRepository(Channel)
|
||||
export class ChannelRepository extends Repository<Channel> {
|
||||
public async pack(
|
||||
src: Channel['id'] | Channel,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
): Promise<PackedChannel> {
|
||||
): Promise<Packed<'Channel'>> {
|
||||
const channel = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const meId = me ? me.id : null;
|
||||
|
||||
|
|
Loading…
Reference in a new issue