Clean up
This commit is contained in:
		
							parent
							
								
									325cd03a59
								
							
						
					
					
						commit
						1fca8d322c
					
				
					 6 changed files with 27 additions and 39 deletions
				
			
		| 
						 | 
				
			
			@ -44,6 +44,7 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
 | 
			
		|||
 | 
			
		||||
	// Response
 | 
			
		||||
	res(await pack(app, null, {
 | 
			
		||||
		detail: true,
 | 
			
		||||
		includeSecret: true
 | 
			
		||||
	}));
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,6 +21,7 @@ export default (params: any, user: ILocalUser, app: IApp) => new Promise(async (
 | 
			
		|||
 | 
			
		||||
	// Send response
 | 
			
		||||
	res(await pack(ap, user, {
 | 
			
		||||
		detail: true,
 | 
			
		||||
		includeSecret: isSecure && ap.userId.equals(user._id)
 | 
			
		||||
	}));
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,6 +34,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
 | 
			
		|||
		});
 | 
			
		||||
 | 
			
		||||
	// Serialize
 | 
			
		||||
	res(await Promise.all(tokens.map(async token =>
 | 
			
		||||
		await pack(token.appId))));
 | 
			
		||||
	res(await Promise.all(tokens.map(token => pack(token.appId, user, {
 | 
			
		||||
		detail: true
 | 
			
		||||
	}))));
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,6 +35,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
 | 
			
		|||
		});
 | 
			
		||||
 | 
			
		||||
	// Reply
 | 
			
		||||
	res(await Promise.all(apps.map(async app =>
 | 
			
		||||
		await pack(app))));
 | 
			
		||||
	res(await Promise.all(apps.map(app => pack(app, user, {
 | 
			
		||||
		detail: true
 | 
			
		||||
	}))));
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue