note-reaction
This commit is contained in:
parent
a97fb08af0
commit
1f82a98384
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue