[API] Fix bugs
This commit is contained in:
		
							parent
							
								
									a875f1182c
								
							
						
					
					
						commit
						9f02d2d1b8
					
				
					 6 changed files with 6 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -19,14 +19,12 @@ module.exports = (params, user) =>
 | 
			
		|||
	new Promise(async (res, rej) =>
 | 
			
		||||
{
 | 
			
		||||
	// Get 'following' parameter
 | 
			
		||||
	const following = params.following === 'true';
 | 
			
		||||
	const following = params.following;
 | 
			
		||||
 | 
			
		||||
	// Get 'mark_as_read' parameter
 | 
			
		||||
	let markAsRead = params.mark_as_read;
 | 
			
		||||
	if (markAsRead == null) {
 | 
			
		||||
		markAsRead = true;
 | 
			
		||||
	} else {
 | 
			
		||||
		markAsRead = markAsRead === 'true';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'type' parameter
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,8 +38,6 @@ module.exports = (params, user) =>
 | 
			
		|||
	let markAsRead = params.mark_as_read;
 | 
			
		||||
	if (markAsRead == null) {
 | 
			
		||||
		markAsRead = true;
 | 
			
		||||
	} else {
 | 
			
		||||
		markAsRead = markAsRead === 'true';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'limit' parameter
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,7 +19,7 @@ module.exports = (params, user) =>
 | 
			
		|||
	new Promise(async (res, rej) =>
 | 
			
		||||
{
 | 
			
		||||
	// Get 'following' parameter
 | 
			
		||||
	const following = params.following === 'true';
 | 
			
		||||
	const following = params.following;
 | 
			
		||||
 | 
			
		||||
	// Get 'limit' parameter
 | 
			
		||||
	let limit = params.limit;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ module.exports = (params, me) =>
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'iknow' parameter
 | 
			
		||||
	const iknow = params.iknow === 'true';
 | 
			
		||||
	const iknow = params.iknow;
 | 
			
		||||
 | 
			
		||||
	// Get 'limit' parameter
 | 
			
		||||
	let limit = params.limit;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ module.exports = (params, me) =>
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'iknow' parameter
 | 
			
		||||
	const iknow = params.iknow === 'true';
 | 
			
		||||
	const iknow = params.iknow;
 | 
			
		||||
 | 
			
		||||
	// Get 'limit' parameter
 | 
			
		||||
	let limit = params.limit;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,17 +36,13 @@ module.exports = (params, me) =>
 | 
			
		|||
 | 
			
		||||
	// Get 'with_replies' parameter
 | 
			
		||||
	let withReplies = params.with_replies;
 | 
			
		||||
	if (withReplies !== undefined && withReplies !== null && withReplies === 'true') {
 | 
			
		||||
		withReplies = true;
 | 
			
		||||
	} else {
 | 
			
		||||
	if (withReplies == null) {
 | 
			
		||||
		withReplies = false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'with_media' parameter
 | 
			
		||||
	let withMedia = params.with_media;
 | 
			
		||||
	if (withMedia !== undefined && withMedia !== null && withMedia === 'true') {
 | 
			
		||||
		withMedia = true;
 | 
			
		||||
	} else {
 | 
			
		||||
	if (withMedia == null) {
 | 
			
		||||
		withMedia = false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue