refactor: prefix Mi for all entities (misskey-dev#11719) (MisskeyIO#160)

cheery-pick from misskey-dev@792622aeadf3e36d50cddec3c64b2ff0105ea927
This commit is contained in:
まっちゃとーにゅ 2023-08-26 08:42:29 +09:00 committed by GitHub
parent 651905e08f
commit 58bbff3738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
234 changed files with 2061 additions and 2061 deletions

View file

@ -8,8 +8,8 @@ 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 '@/misc/json-schema.js';
import type { User } from '@/models/entities/User.js';
import type { GalleryPost } from '@/models/entities/GalleryPost.js';
import type { MiUser } from '@/models/entities/User.js';
import type { MiGalleryPost } from '@/models/entities/GalleryPost.js';
import { bindThis } from '@/decorators.js';
import { UserEntityService } from './UserEntityService.js';
import { DriveFileEntityService } from './DriveFileEntityService.js';
@ -30,8 +30,8 @@ export class GalleryPostEntityService {
@bindThis
public async pack(
src: GalleryPost['id'] | GalleryPost,
me: { id: User['id'] } | null | undefined,
src: MiGalleryPost['id'] | MiGalleryPost,
me: { id: MiUser['id'] } | null | undefined,
): Promise<Packed<'GalleryPost'>> {
const meId = me ? me.id : null;
const post = typeof src === 'object' ? src : await this.galleryPostsRepository.findOneByOrFail({ id: src });
@ -56,8 +56,8 @@ export class GalleryPostEntityService {
@bindThis
public async packMany(
posts: (GalleryPost['id'] | GalleryPost)[],
me: { id: User['id'] } | null | undefined,
posts: (MiGalleryPost['id'] | MiGalleryPost)[],
me: { id: MiUser['id'] } | null | undefined,
) : Promise<Packed<'GalleryPost'>[]> {
return (await Promise.allSettled(posts.map(x => this.pack(x, me))))
.filter(result => result.status === 'fulfilled')