refactor
This commit is contained in:
parent
e3dd3f6b63
commit
41747b6ee2
@ -69,4 +69,19 @@ export class NoteReactionEntityService implements OnModuleInit {
|
|||||||
} : {}),
|
} : {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
public async packMany(
|
||||||
|
reactions: MiNoteReaction[],
|
||||||
|
me?: { id: MiUser['id'] } | null | undefined,
|
||||||
|
options?: {
|
||||||
|
withNote: boolean;
|
||||||
|
},
|
||||||
|
): Promise<Packed<'NoteReaction'>[]> {
|
||||||
|
const opts = Object.assign({
|
||||||
|
withNote: false,
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
return Promise.all(reactions.map(reaction => this.pack(reaction, me, opts)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
.limit(ps.limit)
|
.limit(ps.limit)
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|
||||||
return await Promise.all(reactions.map(reaction => this.noteReactionEntityService.pack(reaction, me, { withNote: true })));
|
return await this.noteReactionEntityService.packMany(reactions, me, { withNote: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user