Improve reaction tooltip
This commit is contained in:
@ -4,6 +4,8 @@ import define from '../../define';
|
||||
import { getNote } from '../../common/getters';
|
||||
import { ApiError } from '../../error';
|
||||
import { NoteReactions } from '../../../../models';
|
||||
import { DeepPartial } from 'typeorm';
|
||||
import { NoteReaction } from '../../../../models/entities/note-reaction';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
@ -24,6 +26,10 @@ export const meta = {
|
||||
}
|
||||
},
|
||||
|
||||
type: {
|
||||
validator: $.optional.nullable.str,
|
||||
},
|
||||
|
||||
limit: {
|
||||
validator: $.optional.num.range(1, 100),
|
||||
default: 10
|
||||
@ -70,7 +76,11 @@ export default define(meta, async (ps, user) => {
|
||||
|
||||
const query = {
|
||||
noteId: note.id
|
||||
};
|
||||
} as DeepPartial<NoteReaction>;
|
||||
|
||||
if (ps.type) {
|
||||
query.reaction = ps.type;
|
||||
}
|
||||
|
||||
const reactions = await NoteReactions.find({
|
||||
where: query,
|
||||
|
Reference in New Issue
Block a user