Do not use _replyIds (#3392)
This commit is contained in:
parent
915d352505
commit
f2f7bdc5a9
3 changed files with 10 additions and 14 deletions
|
@ -33,16 +33,13 @@ export const meta = {
|
|||
};
|
||||
|
||||
export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
||||
// Lookup note
|
||||
const note = await Note.findOne({
|
||||
_id: ps.noteId
|
||||
});
|
||||
|
||||
if (note === null) {
|
||||
return rej('note not found');
|
||||
}
|
||||
const notes = await Note.find({
|
||||
replyId: ps.noteId
|
||||
}, {
|
||||
limit: ps.limit,
|
||||
skip: ps.offset
|
||||
});
|
||||
|
||||
const ids = (note._replyIds || []).slice(ps.offset, ps.offset + ps.limit);
|
||||
|
||||
res(await packMany(ids, user));
|
||||
res(await packMany(notes, user));
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue