Skip to content
Snippets Groups Projects
Unverified Commit ae44fe78 authored by syuilo's avatar syuilo
Browse files

Refactor

parent f8981b3a
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
return rej('cannot set sinceId and untilId');
}
// Construct query
const query = {
deletedAt: null,
......@@ -81,15 +80,13 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
};
}
// Issue query
const mentions = await Note
.find(query, {
limit: ps.limit,
sort: sort
});
mentions.forEach(note => read(user._id, note._id));
// Serialize
res(await packMany(mentions, user));
mentions.forEach(note => read(user._id, note._id));
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment