note-reaction

This commit is contained in:
tamaina 2021-09-12 22:34:27 +09:00
parent a97fb08af0
commit 1f82a98384

View file

@ -1,18 +1,16 @@
import { EntityRepository, Repository } from 'typeorm';
import { NoteReaction } from '@/models/entities/note-reaction';
import { Users } from '../index';
import { SchemaType } from '@/misc/schema';
import { Packed } from '@/misc/schema';
import { convertLegacyReaction } from '@/misc/reaction-lib';
import { User } from '@/models/entities/user';
export type PackedNoteReaction = SchemaType<typeof packedNoteReactionSchema>;
@EntityRepository(NoteReaction)
export class NoteReactionRepository extends Repository<NoteReaction> {
public async pack(
src: NoteReaction['id'] | NoteReaction,
me?: { id: User['id'] } | null | undefined
): Promise<PackedNoteReaction> {
): Promise<Packed<'NoteReaction'>> {
const reaction = typeof src === 'object' ? src : await this.findOneOrFail(src);
return {