2017-12-12 14:20:19 -08:00
|
|
|
import { IFunctionRouteHandler } from 'wherehows-web/typings/ember-cli-mirage';
|
2017-10-02 15:27:38 -07:00
|
|
|
import { ApiStatus } from 'wherehows-web/utils/api/shared';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 };
|