| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | import { IFunctionRouteHandler } from '@datahub/utils/types/vendor/ember-cli-mirage-deprecated'; | 
					
						
							|  |  |  | import { ApiStatus } from '@datahub/utils/api/shared'; | 
					
						
							| 
									
										
										
										
											2017-10-02 15:27:38 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Returns a config object for the config endpoint | 
					
						
							|  |  |  |  * @param {object} config the config table / factory object | 
					
						
							|  |  |  |  * @return {{status: ApiStatus, config: object}} | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2017-12-12 14:20:19 -08:00
										 |  |  | const getConfig = function(this: IFunctionRouteHandler, { configs }: { configs: any }) { | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     status: ApiStatus.OK, | 
					
						
							|  |  |  |     config: this.serialize(configs.first()) | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2017-10-02 15:27:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-12 14:20:19 -08:00
										 |  |  | export { getConfig }; |