summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-10 04:15:20 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-10 04:15:20 +0900
commit0e7cabc622d6ca1781517c80a3735596f8654e08 (patch)
treeb8d18231c178cad6a4c7a45d611c2812063ac528 /src/server/api/endpoints/notes.ts
parentFix bug (diff)
downloadsharkey-0e7cabc622d6ca1781517c80a3735596f8654e08.tar.gz
sharkey-0e7cabc622d6ca1781517c80a3735596f8654e08.tar.bz2
sharkey-0e7cabc622d6ca1781517c80a3735596f8654e08.zip
Fix bug
Diffstat (limited to 'src/server/api/endpoints/notes.ts')
-rw-r--r--src/server/api/endpoints/notes.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/api/endpoints/notes.ts b/src/server/api/endpoints/notes.ts
index 3e3b67a66c..a70ac0588f 100644
--- a/src/server/api/endpoints/notes.ts
+++ b/src/server/api/endpoints/notes.ts
@@ -5,10 +5,7 @@ import $ from 'cafy';
import Note, { pack } from '../../../models/note';
/**
- * Lists all notes
- *
- * @param {any} params
- * @return {Promise<any>}
+ * Get all notes
*/
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'reply' parameter
@@ -73,7 +70,7 @@ module.exports = (params) => new Promise(async (res, rej) => {
}
if (media != undefined) {
- query.mediaIds = media ? { $exists: true, $ne: null } : null;
+ query.mediaIds = media ? { $exists: true, $ne: null } : [];
}
if (poll != undefined) {
@@ -93,5 +90,5 @@ module.exports = (params) => new Promise(async (res, rej) => {
});
// Serialize
- res(await Promise.all(notes.map(async note => await pack(note))));
+ res(await Promise.all(notes.map(note => pack(note))));
});