[API] Fix bugs

This commit is contained in:
syuilo 2017-02-16 14:34:11 +09:00
parent 8786dea90c
commit 4c833edc59
6 changed files with 6 additions and 14 deletions

View File

@ -19,14 +19,12 @@ module.exports = (params, user) =>
new Promise(async (res, rej) => new Promise(async (res, rej) =>
{ {
// Get 'following' parameter // Get 'following' parameter
const following = params.following === 'true'; const following = params.following;
// Get 'mark_as_read' parameter // Get 'mark_as_read' parameter
let markAsRead = params.mark_as_read; let markAsRead = params.mark_as_read;
if (markAsRead == null) { if (markAsRead == null) {
markAsRead = true; markAsRead = true;
} else {
markAsRead = markAsRead === 'true';
} }
// Get 'type' parameter // Get 'type' parameter

View File

@ -38,8 +38,6 @@ module.exports = (params, user) =>
let markAsRead = params.mark_as_read; let markAsRead = params.mark_as_read;
if (markAsRead == null) { if (markAsRead == null) {
markAsRead = true; markAsRead = true;
} else {
markAsRead = markAsRead === 'true';
} }
// Get 'limit' parameter // Get 'limit' parameter

View File

@ -19,7 +19,7 @@ module.exports = (params, user) =>
new Promise(async (res, rej) => new Promise(async (res, rej) =>
{ {
// Get 'following' parameter // Get 'following' parameter
const following = params.following === 'true'; const following = params.following;
// Get 'limit' parameter // Get 'limit' parameter
let limit = params.limit; let limit = params.limit;

View File

@ -26,7 +26,7 @@ module.exports = (params, me) =>
} }
// Get 'iknow' parameter // Get 'iknow' parameter
const iknow = params.iknow === 'true'; const iknow = params.iknow;
// Get 'limit' parameter // Get 'limit' parameter
let limit = params.limit; let limit = params.limit;

View File

@ -26,7 +26,7 @@ module.exports = (params, me) =>
} }
// Get 'iknow' parameter // Get 'iknow' parameter
const iknow = params.iknow === 'true'; const iknow = params.iknow;
// Get 'limit' parameter // Get 'limit' parameter
let limit = params.limit; let limit = params.limit;

View File

@ -36,17 +36,13 @@ module.exports = (params, me) =>
// Get 'with_replies' parameter // Get 'with_replies' parameter
let withReplies = params.with_replies; let withReplies = params.with_replies;
if (withReplies !== undefined && withReplies !== null && withReplies === 'true') { if (withReplies == null) {
withReplies = true;
} else {
withReplies = false; withReplies = false;
} }
// Get 'with_media' parameter // Get 'with_media' parameter
let withMedia = params.with_media; let withMedia = params.with_media;
if (withMedia !== undefined && withMedia !== null && withMedia === 'true') { if (withMedia == null) {
withMedia = true;
} else {
withMedia = false; withMedia = false;
} }