2017-08-18 03:42:40 -07:00
|
|
|
import { IFunctionRouteHandler, IMirageServer } from 'wherehows-web/typings/ember-cli-mirage';
|
2017-08-24 00:23:48 -07:00
|
|
|
import { ApiStatus } from 'wherehows-web/utils/api/shared';
|
2017-10-02 15:27:38 -07:00
|
|
|
import { getConfig } from "./helpers/config";
|
2017-08-15 23:16:38 -07:00
|
|
|
|
|
|
|
export default function(this: IMirageServer) {
|
2017-10-02 15:27:38 -07:00
|
|
|
this.get('/config', getConfig);
|
2017-08-15 23:16:38 -07:00
|
|
|
|
2017-08-18 03:42:40 -07:00
|
|
|
this.namespace = '/api/v1';
|
|
|
|
|
|
|
|
this.get('/datasets/:id/compliance/suggestions', function(
|
|
|
|
this: IFunctionRouteHandler,
|
|
|
|
{ complianceSuggestions }: { complianceSuggestions: any }
|
|
|
|
) {
|
|
|
|
return {
|
|
|
|
status: ApiStatus.OK,
|
|
|
|
autoClassification: {
|
|
|
|
urn: '',
|
|
|
|
classificationResult: JSON.stringify(this.serialize(complianceSuggestions.all())),
|
|
|
|
lastModified: new Date().getTime()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
2017-08-15 23:16:38 -07:00
|
|
|
|
|
|
|
this.passthrough();
|
|
|
|
}
|
2017-10-02 15:27:38 -07:00
|
|
|
|
|
|
|
export function testConfig(this: IMirageServer) {
|
|
|
|
this.get('/config', getConfig);
|
|
|
|
}
|