This commit is contained in:
syuilo
2018-09-05 19:32:46 +09:00
parent db943df0c8
commit a1b82e9723
43 changed files with 167 additions and 196 deletions

View File

@@ -20,9 +20,9 @@ export default (params: any) => new Promise(async (res, rej) => {
const [renote, renoteErr] = $.bool.optional.get(params.renote);
if (renoteErr) return rej('invalid renote param');
// Get 'media' parameter
const [media, mediaErr] = $.bool.optional.get(params.media);
if (mediaErr) return rej('invalid media param');
// Get 'files' parameter
const [files, filesErr] = $.bool.optional.get(params.files);
if (filesErr) return rej('invalid files param');
// Get 'poll' parameter
const [poll, pollErr] = $.bool.optional.get(params.poll);
@@ -79,8 +79,8 @@ export default (params: any) => new Promise(async (res, rej) => {
query.renoteId = renote ? { $exists: true, $ne: null } : null;
}
if (media != undefined) {
query.mediaIds = media ? { $exists: true, $ne: null } : [];
if (files != undefined) {
query.fileIds = files ? { $exists: true, $ne: null } : [];
}
if (poll != undefined) {