This commit is contained in:
tamaina 2021-09-12 23:08:10 +09:00
parent c71844c292
commit 77ed1d7dc4

View file

@ -1,14 +1,12 @@
import { EntityRepository, Repository } from 'typeorm';
import { Emoji } from '@/models/entities/emoji';
import { SchemaType } from '@/misc/schema';
export type PackedEmoji = SchemaType<typeof packedEmojiSchema>;
import { Packed } from '@/misc/schema';
@EntityRepository(Emoji)
export class EmojiRepository extends Repository<Emoji> {
public async pack(
src: Emoji['id'] | Emoji,
): Promise<PackedEmoji> {
): Promise<Packed<'Emoji'>> {
const emoji = typeof src === 'object' ? src : await this.findOneOrFail(src);
return {