summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes/mentions.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-29 15:09:03 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-29 15:09:03 +0900
commitae44fe7818c97ed045178b3de6e13460c5a711c1 (patch)
treea18398805c7c12e8e13ac62535b0c440fefff823 /src/server/api/endpoints/notes/mentions.ts
parentUpdate src/server/api/endpoints/notes/reactions.ts (diff)
downloadsharkey-ae44fe7818c97ed045178b3de6e13460c5a711c1.tar.gz
sharkey-ae44fe7818c97ed045178b3de6e13460c5a711c1.tar.bz2
sharkey-ae44fe7818c97ed045178b3de6e13460c5a711c1.zip
Refactor
Diffstat (limited to 'src/server/api/endpoints/notes/mentions.ts')
-rw-r--r--src/server/api/endpoints/notes/mentions.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/server/api/endpoints/notes/mentions.ts b/src/server/api/endpoints/notes/mentions.ts
index 7de0102c6d..c66421284c 100644
--- a/src/server/api/endpoints/notes/mentions.ts
+++ b/src/server/api/endpoints/notes/mentions.ts
@@ -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));
});