mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 07:13:09 +02:00
Fix bug
This commit is contained in:
parent
eebfb86b2e
commit
0e7cabc622
1 changed files with 3 additions and 6 deletions
|
@ -5,10 +5,7 @@ import $ from 'cafy';
|
||||||
import Note, { pack } from '../../../models/note';
|
import Note, { pack } from '../../../models/note';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all notes
|
* Get all notes
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
*/
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
module.exports = (params) => new Promise(async (res, rej) => {
|
||||||
// Get 'reply' parameter
|
// Get 'reply' parameter
|
||||||
|
@ -73,7 +70,7 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (media != undefined) {
|
if (media != undefined) {
|
||||||
query.mediaIds = media ? { $exists: true, $ne: null } : null;
|
query.mediaIds = media ? { $exists: true, $ne: null } : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poll != undefined) {
|
if (poll != undefined) {
|
||||||
|
@ -93,5 +90,5 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Serialize
|
// Serialize
|
||||||
res(await Promise.all(notes.map(async note => await pack(note))));
|
res(await Promise.all(notes.map(note => pack(note))));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue