mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 08:10:24 +01:00
page
This commit is contained in:
parent
4dfebbd0fe
commit
2c7daf8f0e
1 changed files with 2 additions and 4 deletions
|
@ -1,19 +1,17 @@
|
|||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { Page } from '@/models/entities/page';
|
||||
import { SchemaType } from '@/misc/schema';
|
||||
import { Packed } from '@/misc/schema';
|
||||
import { Users, DriveFiles, PageLikes } from '../index';
|
||||
import { awaitAll } from '@/prelude/await-all';
|
||||
import { DriveFile } from '@/models/entities/drive-file';
|
||||
import { User } from '@/models/entities/user';
|
||||
|
||||
export type PackedPage = SchemaType<typeof packedPageSchema>;
|
||||
|
||||
@EntityRepository(Page)
|
||||
export class PageRepository extends Repository<Page> {
|
||||
public async pack(
|
||||
src: Page['id'] | Page,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
): Promise<PackedPage> {
|
||||
): Promise<Packed<'Page'>> {
|
||||
const meId = me ? me.id : null;
|
||||
const page = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
|
||||
|
|
Loading…
Reference in a new issue