mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-26 17:00:19 +01:00
gallery-post
This commit is contained in:
parent
3a4e3d78b2
commit
c71844c292
1 changed files with 2 additions and 4 deletions
|
@ -1,18 +1,16 @@
|
|||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { GalleryPost } from '@/models/entities/gallery-post';
|
||||
import { SchemaType } from '@/misc/schema';
|
||||
import { Packed } from '@/misc/schema';
|
||||
import { Users, DriveFiles, GalleryLikes } from '../index';
|
||||
import { awaitAll } from '@/prelude/await-all';
|
||||
import { User } from '@/models/entities/user';
|
||||
|
||||
export type PackedGalleryPost = SchemaType<typeof packedGalleryPostSchema>;
|
||||
|
||||
@EntityRepository(GalleryPost)
|
||||
export class GalleryPostRepository extends Repository<GalleryPost> {
|
||||
public async pack(
|
||||
src: GalleryPost['id'] | GalleryPost,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
): Promise<PackedGalleryPost> {
|
||||
): Promise<Packed<'GalleryPost'>> {
|
||||
const meId = me ? me.id : null;
|
||||
const post = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
|
||||
|
|
Loading…
Reference in a new issue