Use Serialized in EntityService

This commit is contained in:
tamaina 2023-06-04 18:26:05 +00:00
parent a1b243bbda
commit 4a104af304
34 changed files with 82 additions and 78 deletions

View file

@ -3,7 +3,7 @@ import { DI } from '@/di-symbols.js';
import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/index.js';
import { awaitAll } from '@/misc/prelude/await-all.js';
import type { Packed } from 'misskey-js';
import type { } from '@/models/entities/Blocking.js';
import type { Serialized } from 'schema-type';
import type { User } from '@/models/entities/User.js';
import type { GalleryPost } from '@/models/entities/GalleryPost.js';
import { bindThis } from '@/decorators.js';
@ -28,7 +28,7 @@ export class GalleryPostEntityService {
public async pack(
src: GalleryPost['id'] | GalleryPost,
me?: { id: User['id'] } | null | undefined,
): Promise<Packed<'GalleryPost'>> {
): Promise<Serialized<Packed<'GalleryPost'>>> {
const meId = me ? me.id : null;
const post = typeof src === 'object' ? src : await this.galleryPostsRepository.findOneByOrFail({ id: src });